Skip to content

Fix MCP malformed response terminal errors#21

Open
fallintoplace wants to merge 1 commit into
openai:masterfrom
fallintoplace:fix/mcp-terminal-error-malformed-responses
Open

Fix MCP malformed response terminal errors#21
fallintoplace wants to merge 1 commit into
openai:masterfrom
fallintoplace:fix/mcp-terminal-error-malformed-responses

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Malformed downstream MCP messages could make response forwarding exit without posting a terminal JSON-RPC error response back to the control plane. That left request/response callers waiting for a timeout instead of receiving an immediate structured failure.

This change reuses the existing terminal downstream error path when the MCP server returns:

  • a non-response message after notifications have been handled
  • a response without a valid JSON-RPC ID
  • a response with an ID that does not match the original request

Tests

  • go test ./pkg/dispatcher/internal -run 'TestProcessorForwardResponsesPostsTerminalErrorOn(NonResponseMessage|InvalidID|IDMismatch)'
  • go test ./pkg/dispatcher/internal

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