fix(mcp): the front door's instructions fit the cuts clients make, with its turn-start check first #4164
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
mvschwarz
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
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.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
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 "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.
- 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.
front-door/v8.Not covered here
Claude Desktop's chat and claude.ai don't pass a server's
instructionsto 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
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
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.
claude-hook-bridge-conversation.test.ts(one line here): 44 tests pass.🤖 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 -->