Skip to content

fix(inbox): send the person's Inbox rules and reminder to MCP sessions - #3567

Merged
backnotprop merged 9 commits into
backnotprop:mainfrom
sx4im:fix-3555-mcp-inbox-rules
Nov 18, 2026
Merged

backnotprop merged 9 commits into
backnotprop:mainfrom
sx4im:fix-3555-mcp-inbox-rules

Conversation

@sx4im

@sx4im sx4im commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What broke
Sessions that connect over MCP only ever saw the built-in server instructions. The Inbox rules and reminder set under Prompts -> Inbox never reached them, so a rule like "always ask before deleting" only applied to sessions started from a terminal.

What changed
The MCP server now builds its instructions per connection from the configured rules and reminder (the ones for all agents), using the same resolvers the terminal path uses, and it follows the same reminder switch: with the reminder off, MCP sessions get nothing of the person's, just as terminal sessions do. When nothing is configured, the instructions are byte-identical to before. When the person's rules or reminder are set, they are added after the built-in lines, and the room they get follows what the connecting client keeps of the instructions, read from its initialize clientInfo:

  • Claude Code 2.1.296 and later (T3 Code's Claude threads too) keeps 4,096 characters: all five built-in summary lines stay, and the rules get 1,913 characters.
  • Claude Code before 2.1.296 keeps 2,048, and so, to be safe, does any other client whose name contains "claude" (Claude Desktop and other Claude apps) or that does not say who it is: the two lines nothing else carries stay, the three the tools already say in full step aside only while the person's text is sent, and the rules get 397 characters.
  • Other clients (Codex, Cursor, Gemini …) have no documented cut, so they get the terminal path's own cap: 9,000 characters for the person's text (8,827 for the rules), so their whole instructions can reach about 11,009 characters.
    These rooms are computed from the built-in text. Nothing is ever cut: the rules come first and are sent whole or left out whole, then the reminder in the room they leave, whole or left out whole. Settings → Prompts shows current Claude Code's room in the rules editor ("N / 1,913 for Claude Code through MCP"; Save is never refused for it) and, under rules or a reminder that is left out somewhere, a "Not sent to …" note naming who misses it. A change applies at the next session, with no restart.

How verified
Unit tests in packages/server/inbox-mcp-instructions.test.ts: which tier each client is (Claude Code versions around 2.1.296, other casing and spacing, no version, Claude Desktop and unknown Claude apps, Codex, Cursor, no name), each tier's fit/leave-out boundary (nothing cut), all five lines present whenever the cap is 4,096 or more, the two lines always present under 2,048, built-in lines never reworded, reminder and rules order, which rules an MCP session follows, the reminder switch (off gives the built-in instructions byte for byte), the Settings data, and initialize requests through the MCP handler sized to their client and reading config.json again. DOM tests in packages/inbox/promptsSettings.test.tsx cover the count and the notes. The end-to-end test in packages/server/inbox.test.ts connects real MCP clients (a non-Claude client and Claude Code 2.1.295) with rules configured and checks what each gets, then changes the config and checks the next connection picks it up. Typecheck for packages/server is clean, and the parity and MCP-adjacent suites pass; the inbox, board-switch and steps-agent suites start an Inbox and run in CI.

Fixes #3555

sx4im and others added 7 commits November 16, 2026 22:35
Sessions that connect over MCP only ever saw the built-in server
instructions, so the Inbox rules and reminder set under Prompts never
reached them. Build the instructions per connection from the configured
text, in place of the five summary lines the tools already describe in
full, and keep the result under Claude Code's 2,048-character cap.
Follow-up on the MCP rules and reminder (backnotprop#3555):

- Never cut: the person's rules and reminder are each sent whole or
  left out whole, rules first. With nothing of theirs sent, the
  instructions are exactly the built-in ones.
- Keep the two summary lines no tool repeats (reply_to "never from
  memory", "pictures go in the body"); only the three the tools say in
  full make room. No fixed line is reworded.
- MCP sessions follow the shared ("All agents") rules and reminder
  only: the instructions go out at initialize, before a session names
  its agent.
- Settings → Prompts shows the MCP room in the rules editor
  ("N / <room> through MCP", computed from the built-in text) and a
  "Not sent to agents connected through MCP" note when rules or the
  reminder are left out there. Save is never refused for it.
- The builder moves to inbox-mcp-instructions.ts so Settings reads the
  same room and fit as the server.
With inboxReminder off (a shared false, or off for Claude Code, Pi and
OpenCode alike in the per-host form Settings writes), MCP sessions get
the built-in instructions byte for byte, as terminal sessions get
neither reminder nor rules. Settings then shows no MCP note.
Claude Code keeps 4,096 characters of server instructions since
2.1.296 (2,048 before). The room for the person's rules now follows the
connecting client's initialize clientInfo:

- Claude Code 2.1.296 and later: 4,096, all five summary lines kept.
- Claude Code before 2.1.296, or a client with no name or version:
  2,048, the earlier behaviour (three lines step aside while the
  person's text is sent).
- Any other client: no documented cut, so the terminal path's cap on
  the person's text.

Text is still sent whole or left out whole; empty settings or the
reminder switch off give the built-in instructions byte for byte.
Settings shows current Claude Code's room in the editor and names who
misses the rules or the reminder in its note.
…is Claude Code 2.1.296+

The client name is trimmed and compared without case. A name containing
"claude" (Claude Desktop, Claude apps we do not know) gets 2,048 unless
it is Claude Code itself with a readable version of 2.1.296 or later.
Settings notes for that tier name other Claude apps and unnamed clients.
@backnotprop backnotprop added ci:e2e Run the full browser suite (Inbox window e2e) on this PR and removed ci:e2e Run the full browser suite (Inbox window e2e) on this PR labels Nov 18, 2026
@backnotprop
backnotprop merged commit e76ba5a into backnotprop:main Nov 18, 2026
40 checks passed
backnotprop added a commit that referenced this pull request Nov 19, 2026
Takes in #3567 (the person's rules and reminder in the MCP server's
instructions). Settings → Prompts keeps both kinds of line true: an agent
connected through MCP (inbox/agents.json) gets no "Not sent to …: no note"
line while the MCP instructions carry the shared rules; the MCP room lines
are unchanged. The docs say where the rules now reach Codex, Gemini CLI and
Qwen Code twice (note and MCP instructions) as a known limit.
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.

Inbox rules and reminder do not reach sessions that connect over MCP

2 participants