fix(coordinator-mcp): answer ping keepalive with empty result - #4412
Conversation
938c52c to
cc379c1
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
cc379c1 to
6c88645
Compare
Maintainer review — coordinator MCP ping keepaliveBase diagnosisThe original head
Correctness reviewThe fix adds a
Tests added
All existing pump tests ( Verification
Thanks @developjik for the clean, spec-correct fix — it unblocks liveness probes (e.g. Claude Code) that were reconnecting on |
Yeachan-Heo
left a comment
There was a problem hiding this comment.
LGTM — spec-correct, minimal, well-tested. Approving on behalf of the maintainer review above.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c88645656
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (request.method === "ping") { | ||
| return { jsonrpc: "2.0", id, result: {} }; |
There was a problem hiding this comment.
Add the ping fix to the coding-agent changelog
This changes user-visible MCP behavior for clients that use ping as a liveness probe, but the commit leaves packages/coding-agent/CHANGELOG.md unchanged, so the fix will be absent from the package's release notes. Add an entry under its ## [Unreleased] section.
AGENTS.md reference: AGENTS.md:L186-L186
Useful? React with 👍 / 👎.
handleJsonRpc handled initialize, tools/list, prompts/list,
resources/list and tools/call but had no branch for the MCP `ping`
method, so clients using ping as a liveness probe (e.g. Claude Code)
received `-32601 unknown_method:ping` and kept reconnecting.
Per the MCP spec, ping MUST return an empty result `{}`. The pump's
dispatch already routes ping as a control frame bypassing the
data-concurrency cap (and pump.test.ts already assumes ping returns an
empty result), but the handler never actually answered it.
Add the missing `ping` branch returning `{ result: {} }` and a focused
regression test against the real handleJsonRpc.
6c88645 to
b27fbe8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b27fbe8681
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (request.method === "ping") { | ||
| return { jsonrpc: "2.0", id, result: {} }; |
There was a problem hiding this comment.
Handle ping in the compatibility entry point
When an integration calls the exported handleCoordinatorMcpRequest compatibility handler rather than createCoordinatorMcpServer().handleJsonRpc (the package wildcard exports make this module addressable), ping still falls through to unknown_method:ping. Add the same empty-result branch to that duplicate JSON-RPC dispatcher so all coordinator MCP entry points implement the keepalive fix consistently.
Useful? React with 👍 / 👎.
handleJsonRpc handled initialize, tools/list, prompts/list,
resources/list and tools/call but had no branch for the MCP `ping`
method, so clients using ping as a liveness probe (e.g. Claude Code)
received `-32601 unknown_method:ping` and kept reconnecting.
Per the MCP spec, ping MUST return an empty result `{}`. The pump's
dispatch already routes ping as a control frame bypassing the
data-concurrency cap (and pump.test.ts already assumes ping returns an
empty result), but the handler never actually answered it.
Add the missing `ping` branch returning `{ result: {} }` and a focused
regression test against the real handleJsonRpc.
Co-authored-by: developjik <developjik@users.noreply.github.com>
handleJsonRpc handled initialize, tools/list, prompts/list, resources/list and tools/call but had no branch for the MCP
pingmethod, so clients using ping as a liveness probe (e.g. Claude Code) received-32601 unknown_method:pingand kept reconnecting.Per the MCP spec, ping MUST return an empty result
{}. The pump's dispatch already routes ping as a control frame bypassing the data-concurrency cap (and pump.test.ts already assumes ping returns an empty result), but the handler never actually answered it.Add the missing
pingbranch returning{ result: {} }and a focused regression test against the real handleJsonRpc.What
Why
Testing
GJC verdict
devbun checkpasses