← Back to Pull requests

fix(mcp): the front door's instructions fit the cuts clients make, with its turn-start check first #4164

Closed
unknown closed this pull request without merging on Nov 29, 2026 16:50 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 13:17 UTC
Author

What a user gets


A person's own agent in Claude Code now receives the front door's whole instructions. That includes the line telling it to check the person's OpenRig items at the start of each turn, and how to handle approvals, wakes and scheduled tasks. Before, those lines were past the point where Claude Code cuts a server's instructions, so they never reached the agent.

Those lines now come first and end by character 1,543. A client whose cut is shorter than Claude Code's still gets them, as long as its cut is past that point. It doesn't get the whole text.

The defect


  • Claude Code shows the model only the first 4,096 characters of a server's instructions (code.claude.com/docs/en/mcp, "Tool search for MCP server authors"). Past that the text is replaced with "… [truncated]".

  • rig mcp serve --front-door's instructions were 5,731 characters on main. Its last nine sentences were cut: from "Where the app runs the openrig plugin's hooks…" to the end, including the turn-start item check, the approvals line, the wake offer and the scheduled-task push warning.

  • In published 0.7.26 (78e8058b) they were 5,586 characters, with eight of 38 sentences past the cut, the same group without the push warning (added later in #4131).
  • What changed


  • The front door's own lines come first, ordered by what must reach the agent:

  • 1. what it is, and the turn-start check;
    2. approvals and wakes;
    3. the person's answers;
    4. which assistant to send to;
    5. the seat's basics.
  • The text is tightened to 4,068 characters, with every rule kept:

  • - The "unless they told you outright…" condition, which appeared twice, now sits once in the "Never choose an answer…" sentence that carries it.
    - The decision-room line moves to rig_queue_decide's own description, which already says the same.
    - The front door's basics name only what a person's agent uses.
  • Other clients: only Claude Code's 4,096 cut was measured here. The 512 and 2,048 below are conservative placement targets for other clients. This change doesn't establish those clients' actual cuts.

  • - Codex's MCP docs ask that a server's first 512 characters stand alone. The first paragraph is 423 and says what the server is and the turn-start check.
    - Claude Desktop's Code tab is reported to keep 2,048 characters for a server the app passes in (anthropics/claude-code#112121). The turn-start, approvals, wake-offer and push lines all end by character 1,543.
  • Version: front-door/v8.

  • Unchanged: the member workflow and the external connections' instructions.
  • Not covered here


    Claude Desktop's chat and claude.ai don't pass a server's instructions to the model at all (anthropics/claude-ai-mcp#93, open). Reaching an agent there would need the guidance in a tool description, which this change doesn't attempt.

    Cost


  • Source: +26 −12.

  • Tests: +55 −2.
  • Measured


    Headless Claude Code 2.1.330 (Sonnet 5.5), with one front-door server and no tool calls. The model was asked whether the instructions are truncated, to quote their last sentence, and to quote any turn-start rule.

    | Build | Marked truncated | Last sentence it sees | Turn-start rule |
    |---|---|---|---|
    | main | yes ("… [truncated]") | cut off at "Where the app runs the openrig pl…" | not visible |
    | this branch | no | "A seat whose activity is unknown is not idle." (the true last sentence) | quoted in full |

    Tests


  • New in mcp-server.test.ts:

  • - Every must-reach line sits inside its placement budget: 512 or 2,048, the conservative targets for other clients, or Claude Code's measured 4,096.
    - The whole front door fits inside 4,096. On main this fails: 5,731 is over 4,096.
    - The must-reach list is pinned in its own test.
  • The front door's existing test checks the shortened assistant-choice text for the same rules (the left-team block holds even if the person insists).

  • The CLI's 25 MCP and queue test files: 574 tests pass at this head.

  • The daemon's claude-hook-bridge-conversation.test.ts (one line here): 44 tests pass.

  • CLI tsc: passes.
  • 🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Improvements
    The assistant checks open items at the start of each turn and surfaces waiting questions before responding.
    It records a person’s exact answer and distinguishes decisions made under their instruction from decisions it is authorized to make on their behalf.
    Guidance on app approvals and wake requests is clarified, along with how the assistant selects available team members, handles pickup, and follows up.
    * Answers remain focused on the question asked and avoid claiming unresolved items.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 613 lines (+459 / -154) across 7 files Reviewer: mvschwarz Review duration: 212m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.55) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 613 lines diff across 7 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.384
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4164"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 55.2% (MEDIUM) · Higher = larger blast radius
    55.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.8% · Safe to merge
    21.8%