Repository navigation
Inbox reminder for Qwen Code, Gemini CLI, Amp, Kiro and Codex through their own hooks - #3600
Draft
backnotprop wants to merge 4 commits into
Draft
backnotprop wants to merge 4 commits into
backnotprop wants to merge 4 commits into
Conversation
…rough their own hooks One command, plannotator inbox reminder --agent <id>, prints the shared reminder (the person's own text and rules included) in each agent's documented hook format, or nothing when it is off, not set up, or fails. It never starts the Inbox. - Qwen Code: a SessionStart hook in our extension (1.1.0). - Amp: our plugin, on a thread's first prompt, hidden. - Gemini CLI, Kiro, Codex: one entry of ours in the agent's global hook config (Kiro: a file of our own), written once, losslessly, removed byte for byte by reach off and plannotator uninstall. - Codex: the connect line says once to approve the hook in /hooks; Plannotator never writes Codex's trust record. - Settings: the reminder switch, Prompts rows and rules for each.
- The CLI waits for the whole reminder to reach stdout before it exits. - The wake line only when the Inbox can really wake the agent: Qwen with Plannotator's trusted-sender token; Codex always gets the no-wake line. - A damaged config.json prints nothing. - A hook the person removed stays removed through off and on. - Kiro: re-check the file before creating it; a shared file loses only our hook. - A moved CLI: our recorded entry is rewritten to the current path. - Docs: the true load order and timing; Windows quoting listed as unverified.
- The connect-run test expects hook_review on the Codex note entry: the same pass added Codex's reminder hook. - The uninstall test builds the shown paths with the platform's separator, as the shared display path does.
This was referenced Nov 28, 2026
This branch has not been deployed
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.
Every agent that reaches the Plannotator Inbox through its MCP server now gets the Inbox reminder the way Claude Code does: when a conversation starts, and again after each compaction where the agent has such an event. The reminder obeys its on/off switch, and the person's rules follow under
INBOX_RULES_LEAD.How it works
plannotator inbox reminder --agent <id>(packages/shared/inbox/reminder-hook.ts):resolveInboxReminderTextfor that agent, in the agent's documented hook format.inbox/agents.json), whenconfig.jsonis damaged, or on any failure.writeWholeToStdout), so a long reminder through a pipe is not cut off.packages/server/inbox-reminder-hooks.ts).appendJsonArrayIteminjson-edit.tschanges no other byte, and comments are kept.plannotator uninstalltake it out byte for byte. A file Plannotator created is deleted.inbox/reminder-hooks.jsonfor debugging. It is not shown to the person.Per agent (each one proven by documentation only; no live run)
SessionStart(startup, resume, clear, compact)hooks/hooks.json:{ "type": "command", "command": "plannotator inbox reminder --agent qwen", "timeout": 10000 }, no matcher; extension 1.1.0SessionStart(startup, resume, clear); no context after a compaction (PreCompresscannot add any)~/.gemini/settings.jsonhooks.SessionStart:{ "matcher": "*", "hooks": [{ "name": "plannotator-inbox-reminder", "type": "command", "command": "<plannotator> inbox reminder --agent gemini", "timeout": 10000 }] }agent.start, a thread's first prompt only;{ message: { content, display: false } }SessionStartandPostCompact~/.kiro/hooks/plannotator-inbox.json(versionv1, two command hooks, timeout 10 s)SessionStart, no matcher (startup, resume, clear, compact, fork)$CODEX_HOME/hooks.jsonhooks.SessionStart:{ "hooks": [{ "type": "command", "command": "<plannotator> inbox reminder --agent codex", "timeout": 10 }] }Codex runs a new hook only after the person approves it in
/hooks. Plannotator never writes that approval. The Inbox's connect line says so once, after the Codex note line: "Approve Plannotator's new hook in Codex with /hooks."Wake wording
The reminder says "Their reply comes back here." only when the Inbox can really wake that agent. Otherwise it uses the existing no-wake line. No agent-facing sentence is new or reworded; only the choice between the two existing lines changed.
qwenCanWakeininbox-qwen-trust.ts) and reads one small file.codex queue) only by running the Codex CLI, which can take seconds. The hook must stay fast and must not start the Inbox, so it does not claim the wake.Cost at session start
The reminder branch runs after the CLI's static imports are evaluated; only the reminder module itself is loaded on demand. From source: importing the reminder module alone takes about 20 ms; a whole CLI run in the tests takes about 200 to 250 ms. Returning before the heavy imports needs a separate compiled entry, which every build and release step would have to name, so it is not in this PR. A timing on the release binary is advised before release. No network runs before the reminder is printed.
For the owner
plannotator uninstall)plannotator-inbox, the MCP server's name, where it saysplannotator_inbox.Open, the owner's calls (not in this PR)
/hooks, the write was refused, or the person removed the hook. A status line would be a UI change./hooksline: people whose Codex note was shown earlier get no line. Codex CLI warns at start; Codex Desktop and T3'scodex app-servermay skip the unapproved hook silently.codex exec,gemini -p,qwen -p) get it too.BeforeAgent(context for one turn only) would cover it without piling up.Unverified
shellfield, bash or powershell, with no stated default). The command is quoted as before; a CLI path with a space is not proven to run under both cmd and PowerShell.Joining up with #3598
#3598 puts the rules in note files.
resolveInboxReminderText, in one place:inboxHookReminderText.inboxReminderRulesFor(config, host, place), so the rules are not given twice. This is done on this branch after Inbox: your rules in each agent's own instructions file #3598 merges.inboxNoteFileOfneeds Codex and Gemini CLI note files (and Qwen Code's when it gets one).Follow-up (not in this PR)
DeepSeek Harness, Devin and Windsurf, Cline, Cursor, and agents with only the MCP server and no hook of ours.
Tests
New in the review fixes:
writeWholeToStdout.config.jsonalone prints nothing and exits 0.Run locally, one file at a time, all green. After the review fixes, the reminder-hook, command, reminder-hooks, qwen-trust and uninstall tests were run again:
packages/shared/inbox/reminder-hook.test.tsapps/hook/server/inbox-reminder-command.test.tspackages/server/inbox-reminder-hooks.test.tspackages/server/inbox-qwen-trust.test.tspackages/server/json-edit.test.tspackages/server/uninstall.test.tspackages/server/inbox-agent-notes.test.tspackages/server/inbox-agent-notes-auto.test.tsapps/qwen-code/qwen-code.test.tsapps/amp-plugin/plannotator.test.tspackages/shared/inbox-reminder-text.test.tsapps/hook/hooks/mod/enabled.test.tspackages/shared/prompts.test.tspackages/shared/prompts-integration.test.tspackages/inbox/promptsSettings.test.tsxandpackages/inbox/connectLine.test.tsxtests/no-browser-sentinel.test.ts,tests/windows-hide-guard.test.tsandtests/child-env-guard.test.tsTypecheck passed for core, shared, server, the mod,
apps/hookserver,packages/inboxandapps/inbox.Left to CI, because they start an Inbox:
packages/server/inbox-prompts.test.tsandpackages/server/inbox-agents-settings.test.ts(updated for the new hosts, plus a Codex case;inbox-prompts.test.tsalso for the wake wording)packages/inbox/reloadHosts.test.tsxtests/never-touch-the-real-inbox.test.tsapps/hook/server/inbox-help.test.tsvendor.sh)