Repository navigation
fix(mcp): older linked environments can route threads to a founder inbox - #111
Merged
Merged
Conversation
A linked environment on a release from before `inboxRouting.reason` has no such field in its tool schema, so its agent cannot send one. The server rejected every founder or shared route from it for a missing reason: a dead end. Peers now announce `T3-Peer-Features: inbox-reason`. A linked caller without the header gets its reason-less route filed as `fyi`, which is how lanes filed before reasons already show. Current peers still must give one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nder routes Review round fixes: - create_threads files a reason-less founder route from an older linked environment as FYI, like t3_thread_update and t3_thread_launch already do. - withLegacyPeerInboxReason stamps `fyi` only on a route the strict guard would reject (one that reaches a founder or the shared inbox); a route that stays in Agents keeps no reason. - A launch placed on another environment forwards the filed route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An agent on a linked environment running an older release tried to file a thread on another environment into a founder's inbox (
t3_thread_update action:'route'/t3_thread_launchwithinboxRouting). The receiving server, on a newer release, requiresinboxRouting.reasonfor a founder or shared inbox. The older release's MCP tool schema has noreasonfield, so the agent could not send one, and every retry failed the same way. The rejection told it to pass a field its tools do not have: a dead end caused only by version skew.The receiving side had no way to tell an older peer from a current one.
PeerMcpClientalways sendsclientInfo: {name: "t3code-peer", version: "1"}.Change
PeerMcpClientsendsT3-Peer-Features: inbox-reasonon every call./mcpreads it only from a linked client, intoclient.peerFeatures. A malformed value reads as no features.isLegacyInboxPeer(scope)is true for a linked client that did not announceinbox-reason, meaning a release from before this one.withLegacyPeerInboxReason(contracts) files a reason-less route from such a peer asfyi. That is what lanes filed before reasons existed already show as (founderInboxLane). It applies tot3_thread_update(ThreadMetadataMcpService.update),t3_thread_launch(local and placed on another environment) andcreate_threads. It stampsfyionly on a route the strict guard would reject, meaning one that reaches a founder or the shared inbox. A route that stays in Agents keeps no reason. A route that carries a reason, or one that names no inbox, is unchanged.Tradeoff: an older peer's agent can file into a founder's inbox without stating a reason. It shows there as FYI, not as an action, so it cannot demand attention, and the gap closes as soon as that peer updates. Rejecting it was worse, because the agent had no field to fix the call with.
Scope
A bug fix for cross-version linked environments on the fleet release branch. It adds no new routing behavior for current releases.
Review round
One bot review (claude-sonnet-5-5) found that
create_threadswas not covered (should-fix). It also flagged two minor items: an agents-only route gotfyistamped on it, and the placed-launch branch forwarded the unfiled route. All three are fixed in ec1d142. Not added: a middleware-level test of a header from a non-linked client. The trust check (client.linked === true) is unchanged and is covered by the round-trip test.Verification
packages/contracts/src/threadInbox.test.ts, new case: a reason-less route to Kameron is still rejected in strict mode. With the legacy flag it becomesreason: "fyi", passesagentInboxRoutingErrorandagentLaunchInboxError, and lands in Kameron's lane asFYI. A current peer (flag off) is still rejected. A sent reason and a launch with no inbox are returned untouched. It also checks that agents-only routes are left alone and that a shared-inbox launch is filed. 19/19 pass.apps/server/src/peer/PeerMcpClient.test.ts, new case: a real peer round trip through/mcp. The callee seespeerFeatures: ["inbox-reason"]andisLegacyInboxPeerfalse. A linked client without the header is legacy, and a non-linked client never is. 7/7 pass.project/handlers.test.ts,threadMetadataMcp.test.tsandMcpHttpServer.test.ts(114 server tests pass after the review fixes).effect-tsgotypecheck is clean for contracts and server.vp fmt --checkandvp lintare clean on the changed files.Base note: this targets
release/native-0.1.10, the branch the fleet builds from.Deploy: fleet
Model: claude-opus-5-5
Task: fix
🤖 Generated with Claude Code