Repository navigation
fix(mcp): preserve readiness and attributed stderr diagnostics - #128
RecursiveIntell wants to merge 2 commits into
Conversation
૮ >ﻌ< ა ci reviewran on cb202b7 — test(mcp): model owned pre-ready discovery and recovery sign
|
|
Fixture-only correction for original failed Python slice 9/12: the old fake required readiness before owned registration and never signaled readiness on recovery. Corrected fixture executes real discovery/canonical ownership before transport readiness; transport/list_tools remain inert and production readiness is unchanged. Exact hosted assertion reproduced (1 pass/1 fail), then 18/18 scoped offline cases passed; independent review and exact forward/reverse replay accepted. Original hosted result remains 3173 passed, 1 failed, 41 skipped. Original 79-case proof is historical packet evidence, not proof of current FastMCP adoption/provider readiness. Published head |
MCP status can report connected as soon as a session exists, before discovery finishes, and retain that readiness through an exceptional reconnect. Require the existing task's session, ready event and empty error state; clear readiness through the lifecycle owner before each actual transport attempt. Ready servers with zero tools remain connected.
Give each stdio attempt one exclusive stderr capture in its config home and record typed ownership/path metadata in
mcp-stderr.log. Close attempt handles and restore context on every exit, preserve original exceptions and SDK protocol parameters, and separate terminal metadata from unterminated or bare-CR child output. Metadata identifies the config home and client parent PID; it does not certify the child executable, HOME or release.Update the native
hermes logs mcpreader to show attributed child stderr from those captures while preserving legacy rows and shared non-MCP readers. Validate profile/path/UUID/PID ownership, retain split records across polls, frame incomplete previews, and continue after oversized lines with visible reader notices. The preview has a 1 MiB tail window/output-character budget, 10,000-row cap, 64 KiB follow chunk/pending-line limits and a latest-128-attempt cap. Full stderr stays in its capture file; there is no relay or duplicate storage.Validation: 79 cases passed against the final five-file hashes (43 authored and 36 existing), followed by independent source-review acceptance and byte-exact full/incremental forward/reverse replay. The actual run/stdio orchestration and native reader handlers were exercised with inert transports and temporary files. No existing tests changed. All failing and intermediate evidence, including the original degraded 37-pass packet, remains preserved.
Tests used an offline private sandbox, isolated homes, read-only existing dependencies, one shared-lock worker and zero retries. The unchanged canonical per-file runner was invoked with
-j1; the launcher's unconditional whole-treecompileall -j0conflicts with the user worker limit and was disclosed as an exception. The real-child process-group test was deselected. Incremental packet scratch stayed below 1 MiB of the authorized 48 MiB total budget.Hostile parent-directory replacement races and equal-or-larger same-inode rewriting between polls remain unproven. Core owns integration and hosted CI. Live launch correlation and activation remain separate; this source packet performs no installed-runtime, configuration, memory or service changes.
This draft does not establish that current FastMCP adoption is fixed. Offline source evidence and hosted CI are separate. Exact reverse patch SHA256
ed417e2ece76513ad6ee33fde5d761bd5b14704e2432e6dbf4eb7bc588184ba9restores this focused source delta; no live rollback or activation accompanies publication.