Skip to content

[codex] fix MCP workflow tool calls#256

Merged
mbakgun merged 2 commits into
mainfrom
fix/mcp-server-behaviour
Jun 26, 2026
Merged

[codex] fix MCP workflow tool calls#256
mbakgun merged 2 commits into
mainfrom
fix/mcp-server-behaviour

Conversation

@mbakgun

@mbakgun mbakgun commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What changed

  • JSON-RPC MCP tools/call now treats fileUploadTrigger workflows like the REST MCP tool path: it mints an upload slot and returns the upload payload instead of executing the workflow with empty trigger input.
  • Legacy SSE tools/call requests now return 202 Accepted immediately and deliver the final JSON-RPC response through the SSE channel.
  • Long-running MCP tool calls now emit periodic progress updates when the client provides _meta.progressToken; Streamable HTTP tool calls also stream SSE heartbeat comments so clients receive bytes while the workflow is running.
  • Added backend coverage for default and named MCP servers, file upload JSON-RPC calls, legacy SSE progress, and Streamable HTTP progress/final responses.

Why

The JSON-RPC path skipped the existing file-upload special case and executed file upload workflows without uploaded file input, producing { "fileUpload": { "file": {}, "uploaded_at": null } }.

Long-running workflow calls also held the MCP POST open until completion, so clients with first-byte or idle timeouts could disconnect before Heym returned the tool result.

Validation

  • SECRET_KEY=test-secret-key-for-tests-only-32-bytes uv run pytest tests/test_mcp_jsonrpc_tool_calls.py tests/test_mcp_servers.py tests/test_mcp_origin_mismatch.py
  • SECRET_KEY=test-secret-key-for-tests-only-32-bytes ./check.sh

@mbakgun mbakgun marked this pull request as ready for review June 26, 2026 06:05
@mbakgun mbakgun merged commit c6c7659 into main Jun 26, 2026
2 checks passed
@mbakgun mbakgun deleted the fix/mcp-server-behaviour branch June 26, 2026 06:06
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