Compare commits

...

1 Commits

Author SHA1 Message Date
Josh McKinney
ee3659372c test(mcp-server): make Chat Completions WireMock emit [DONE]
Windows CI sometimes flakes in `codex-mcp-server` tests that stub `/v1/chat/completions` with WireMock.

The mock SSE payload ended with `data: DONE` (nonstandard) instead of the upstream terminal sentinel `data: [DONE]`. Depending on platform/timing, that can leave the client waiting for stream termination via connection close.

Fix the fixture to emit `data: [DONE]` to match server wire format. No changes to production protocol handling.
2026-01-09 15:47:52 -08:00

View File

@@ -34,7 +34,7 @@ pub fn create_shell_command_sse_response(
});
let sse = format!(
"data: {}\n\ndata: DONE\n\n",
"data: {}\n\ndata: [DONE]\n\n",
serde_json::to_string(&tool_call)?
);
Ok(sse)
@@ -53,7 +53,7 @@ pub fn create_final_assistant_message_sse_response(message: &str) -> anyhow::Res
});
let sse = format!(
"data: {}\n\ndata: DONE\n\n",
"data: {}\n\ndata: [DONE]\n\n",
serde_json::to_string(&assistant_message)?
);
Ok(sse)
@@ -89,7 +89,7 @@ pub fn create_apply_patch_sse_response(
});
let sse = format!(
"data: {}\n\ndata: DONE\n\n",
"data: {}\n\ndata: [DONE]\n\n",
serde_json::to_string(&tool_call)?
);
Ok(sse)