Skip to content

fix(mcp): older linked environments can route threads to a founder inbox - #111

Merged
nullStack65 merged 2 commits into
release/native-0.1.10from
fix/legacy-peer-inbox-reason
Nov 19, 2026
Merged

nullStack65 merged 2 commits into
release/native-0.1.10from
fix/legacy-peer-inbox-reason

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

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_launch with inboxRouting). The receiving server, on a newer release, requires inboxRouting.reason for a founder or shared inbox. The older release's MCP tool schema has no reason field, 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. PeerMcpClient always sends clientInfo: {name: "t3code-peer", version: "1"}.

Change

  1. Peers announce what their tools support. PeerMcpClient sends T3-Peer-Features: inbox-reason on every call. /mcp reads it only from a linked client, into client.peerFeatures. A malformed value reads as no features.
  2. isLegacyInboxPeer(scope) is true for a linked client that did not announce inbox-reason, meaning a release from before this one.
  3. withLegacyPeerInboxReason (contracts) files a reason-less route from such a peer as fyi. That is what lanes filed before reasons existed already show as (founderInboxLane). It applies to t3_thread_update (ThreadMetadataMcpService.update), t3_thread_launch (local and placed on another environment) and create_threads. It stamps fyi only 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.
  4. Current peers, local agents and every non-linked client keep the strict guard: a founder route without a reason is still rejected with the existing actionable message.

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_threads was not covered (should-fix). It also flagged two minor items: an agents-only route got fyi stamped 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

  1. 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 becomes reason: "fyi", passes agentInboxRoutingError and agentLaunchInboxError, and lands in Kameron's lane as FYI. 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.
  2. apps/server/src/peer/PeerMcpClient.test.ts, new case: a real peer round trip through /mcp. The callee sees peerFeatures: ["inbox-reason"] and isLegacyInboxPeer false. A linked client without the header is legacy, and a non-linked client never is. 7/7 pass.
  3. Also run: project/handlers.test.ts, threadMetadataMcp.test.ts and McpHttpServer.test.ts (114 server tests pass after the review fixes). effect-tsgo typecheck is clean for contracts and server. vp fmt --check and vp lint are clean on the changed files.
  4. Not checked: a live call from an actual older release. The fix needs only the receiving server to run this build, and older clients need no change.

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

nullStack65 and others added 2 commits November 19, 2026 19:51
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>
@nullStack65
nullStack65 merged commit 19a34b5 into release/native-0.1.10 Nov 19, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant