Skip to content

Fix MCP SSE response connection reuse race - #3268

Open
hengyunabc wants to merge 1 commit into
masterfrom
codex/fix-mcp-sse-connection-reuse
Open

hengyunabc wants to merge 1 commit into
masterfrom
codex/fix-mcp-sse-connection-reuse

Conversation

@hengyunabc

Copy link
Copy Markdown
Collaborator

MCP POST SSE responses advertise Connection: keep-alive, but the transport closes the connection after sending each response. HTTP clients can cache and reuse the closing connection, causing intermittent Unexpected end of file from server failures on consecutive tools/call requests.

Advertise Connection: close for these responses to match the existing transport lifecycle. Add a regression assertion to the MCP integration test so this mismatch fails deterministically instead of depending on connection-close timing.

Validation:

  • The regression assertion fails against the previous response header (expected: close, but was: keep-alive).
  • Java 8: ./mvnw -B -ntp -pl packaging -am package -DskipTests — passed.
  • Java 8: ./mvnw -B -ntp -pl arthas-mcp-server -am test — 13 tests passed.
  • Java 21: ./mvnw -B -ntp -pl arthas-mcp-integration-test verify — 38 integration tests passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T07:22:28.630879Z b7d454b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant