Repository navigation
fix(mcp): validate doctor probe against its discovered output contract - #1461
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: This merged while I was testing, so this is a post-merge check. The fix works. The doctor now catches a bad probe reply. Base said "healthy" for it. Good replies give the same report as before, byte for byte. When the probe fails, head still shows the server and tool list. No test processes were left behind. Healthy pathReal
I did not need to clean up any fields. There were no times, pids or paths. Stderr was empty. Bad repliesA small stdio proxy sat in front of the real server. It changed only the
Exit code was 0 when healthy and 1 when not. That held in all 72 runs. A few small notes. None of them block this PR.
I also found why base skipped the check. See "SDK check" below. Cold startReal CLI doctor, pinned to two cores. Ten runs each after two warm-ups, interleaved. Load went up to 5.6, so these are rough.
The ranges overlap on every Node. Head waits for the tool list before the probe now. A small cost fits that, but these runs can't prove it. Tests
Not run
Thanks N0zoM1z0 for the clear issue and the replay fixture. How the bad replies were made
Head reasons, word for word (Node 24)
Never took 30.0 to 30.3 s on both trees. SDK checkThe issue left the SDK cause open. I think I found it. The SDK picks its output check when
Cold start raw
Test setup
🤖 Generated with Claude Code (Opus 5.5) 🦊 |
morluto#1461) Validate the target-free probe against the named definition discovered from the complete production catalog. Preserve initialized server and inventory observations when the SDK rejects the probe, and retain the schema failure reason, absolute deadline and owned-child cleanup. The negative stdio replay regression fails on original main and passes the fix; actual production-boundary fault injection confirms rejection. Nine doctor/help tests, serial full static checks and real small-target CLI/MCP parity pass. Successful doctor reports remain byte-identical. No performance or model-token reduction is claimed. Closes morluto#1454. Refs morluto#1065, morluto#723, morluto#1433.
The MCP doctor could report
healthy: truefor abinary_sessionreply that violated the output schema advertised by the same production server. Discover the complete tool/prompt inventory first, select the probe definition by name, and pass that definition to the SDK call. Keep the absolute deadline and owned-child cleanup.A rejected probe now reports the request/schema failure while retaining the already observed server and inventory, rather than replacing them with an undifferentiated transport failure. The successful report and default Evidence contract remain unchanged.
Validation:
This is a diagnostic correctness fix. Interleaved cold CLI timings did not establish a speedup, and no model-token saving is claimed. The SDK internal cause of the original default-path behavior remains unverified.
Closes #1454. Refs #1065, #723, #1433.