Repository navigation
test(dxt): pin the server/discover probe answer before initialize - #271
Conversation
Claude Desktop sends server/discover before initialize. If the server exited or closed stdio on that unknown method, the host would log "Couldn't start for Cowork and Code sessions ... the connection closed during the server/discover probe". The built dxt-entry.js answers -32601 Method not found and stays up; this test spawns it in a sandbox and keeps it that way (checked by making it exit on the probe: the test fails with "server exited with code 0"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
Reviewer's GuideAdds an isolated process-level regression test pinning the server’s behavior for a pre-initialize File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review follow-up: - The test pinned -32601, which is only the SDK's generic answer while it has no server/discover handler; a later SDK that implements the method would have failed it while helping the host. It now requires an answer to id 1: a result, or "Method not found". - NODE_ENV=test (set by Vitest) and CI switch off the multi-site fail-closed guard; the child now runs without them, like the installed extension. - Liveness is checked with a ping after tools/list instead of child.exitCode (null until the exit event is processed). - Exit failures name the code, signal and the server's last stderr; stdin EPIPE is ignored; stdout is decoded as UTF-8; the child is awaited on cleanup. Checked by making the built entry exit on the probe: fails in 0.4 s with "server exited (code 3 ...)" and the server's stderr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 4.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request
Description
P1 in the v4.0.9 re-test results: Claude Desktop logged
Couldn't start for Cowork and Code sessions … the connection closed during the server/discover probe. The note asked whether the server exits or closes stdio on an unknownserver/discoverrequest sent beforeinitialize.It doesn't. The built
dist/dxt-entry.jsanswers with JSON-RPC-32601 Method not found, stays up, and then completesinitialize→tools/list(71 tools). In the Claude log, the error appears only during the 23:09Z reinstall burst on 2026-10-08. Every start since 23:10Z completes the probe (Era probe verdict: legacywithout "sibling did not complete the exchange"), including this morning's at 09:16Z. No code change is needed, so this PR only adds a test to keep it that way.Type of Change
Changes Made
tests/bin/dxt-discover-probe.test.js:dist/dxt-entry.jswith the same isolation asmcp-wordpress-entry.test.js: a real copy ofdist/and a sandboxHOME, so no real config is read;server/discover, expects-32601, theninitializeandtools/list, and expects the process to still be running;Testing
server/discover, it fails withserver exited with code 0in 0.4 s. I then rebuiltdist/clean.format:check,security:scanNotes for reviewers
test:does not cut a release.Security
Independent review follow-up
-32601: it requires an answer to the probe (a result, or Method not found), so an SDK that implementsserver/discoverwon't break it.NODE_ENV=test/CI, like the installed extension (those switch off the multi-site guard).ping; exit failures report code, signal and the server's stderr; stdout is decoded as UTF-8; the child is awaited on cleanup. Mutation-checked again (fails in 0.4 s with the server's stderr).🤖 Generated with Claude Code
Summary by Sourcery
Tests:
server/discoverprobe, remains running, and completes the normal initialization and tool-listing handshake.