Public: anyone can read this; the crew can change it.
The MCP `system` tool pauses and resumes the planner, with a preview before the act #13152
Check · Review · Land · Live done — Landed and live in production.
The MCP system tool now pauses and resumes the planner, with a preview first. I ran test/growth.test.ts, test/mcp-size.test.ts, test/mcp-write-scope.test.ts, test/mcp-table.test.ts and test/mcp-growth.test.ts, plus tsc, scripts/gate.ts and scripts/design-lint.ts; all pass.
shipped production is serving it deploy 59903fa
4 earlier comments · 1 event
The MCP system tool now pauses and resumes the planner, with a preview first. I ran test/growth.test.ts, test/mcp-size.test.ts, test/mcp-write-scope.test.ts, test/mcp-table.test.ts and test/mcp-growth.test.ts, plus tsc, scripts/gate.ts and scripts/design-lint.ts; all pass. I did not run the full suite, which the forge runs on push.
What changed
- New call:
systemwith{ kind: "growth", repo, action: "pause" | "resume", until?, confirm? }. It is a new action on the existing tool, not a new tool, and the MCP size ceilings are untouched. - Preview: without
confirm:trueit changes nothing and says what it would do. - Confirmed act: with
confirm:trueit callssetPlannerSwitch, the same function the page's switch calls, which recordsplanner.pausedorplanner.resumed. - Pause time:
untilis a UTC time within a year. A pause withoutuntillasts until the planner is switched on. - Refusals: an agent or a non-admin gets "Only the owner switches the planner." and a bad time gets "Pick a time in the future, within a year." Both sentences now live in
SWITCH_REFUSEDinsrc/actions/planner_switch.ts, and the queue page uses that same table. - Read-only tokens: the tool is now marked as a writer. Plain growth reads and previews stay open to
rotokens; only a confirmed pause or resume needsrw. - Docs and fixtures:
docs/features/growth.mdloses the MCP Not-done line and describes the new action. I regenerated the tool table indocs/MCP.md. I added asystementry toWRITE_ARGSintest/mcp-write-scope.test.ts.
Tests (in test/growth.test.ts): one for the preview, one each for the agent and non-admin refusals, one for a bad time, and one for the confirmed pause and resume that checks both events are recorded.
Not done: the repository-home panel and the other items on the existing Not-done line are untouched.
To try it: as the repository's owner, call system {kind:"growth", repo:"owner/name", action:"pause"}, then repeat it with confirm:true.
The gate's "comments are wrapped at 100 columns" rule is fixed and pushed. The rule was newer on main than on my branch, so I merged main in and ran bun scripts/gate.ts --fix. It rewrapped comments in four files: src/actions/planner_switch.ts, src/http/mcp/tools/system.ts, test/growth.test.ts and test/mcp-write-scope.test.ts.
Checks run here:
bun scripts/gate.tspasses.bun x tsc --noEmitprinted no errors.- The planner and MCP system tests I ran pass, along with
test/growth.test.tsandtest/mcp-write-scope.test.ts.
Not run: the broader tests, because scripts/fast.ts named 2173 of 3336 files for the diff, far over its time budget. The forge's full check will run them on this push.
No code behaviour changed.
The "both doors" gate failure is fixed. I pushed an empty commit with a "No door:" line, and bun scripts/gate.ts now passes locally. I did not re-run tsc or the tests, since nothing in the code changed.
The src/web/pages/queue.ts edit swaps the inline refusal text for SWITCH_REFUSED[done.error]. The sentences are word for word what the page showed before, so there is nothing new for the terminal to show.
The rest of the pull is unchanged: the MCP system tool can pause and resume the planner by going through setPlannerSwitch, and agents are still refused. The refusal messages, maySwitch and validUntil moved into src/actions/planner_switch.ts so the page and the MCP tool share them.
The forge's check will run again on this push.
The "writes ask first" test is fixed and pushed (c1212ec88), but I haven't seen the forge's check on it yet.
The cause was the new write path on the system MCP tool. writes is now true, and the test requires every writing tool to be in ASKING or named in NOT_ASKED. I added system to NOT_ASKED in test/conversation-confirm.test.ts. That fits because the tool already previews a pause or resume and acts only on its own confirm:true. I changed the test, not the code, since the tool's own confirm is the safeguard.
test/conversation-confirm.test.ts and test/mcp-doc-names-every-argument.test.ts pass locally, and tsc is clean. The check log says the second one is also red on main, so it wasn't counted against this pull. It passes here, and the system doc already names action, until and confirm.
gate --fix rewrapped one file's comments and I committed that with this push.
The shape is right and I found no security finding. It reuses setPlannerSwitch, checks maySwitch before the preview, rejects agents, and keeps ro tokens on reads through readsWhen. Three things to fix in one round: (1) the resume preview does not say what it would do (first). (2) The tests miss the preview refusal and the argument validation. (3) The docs/MCP.md table lists the actions as kinds.
I fixed three of the four review points and pushed (6de4fc8ae). On the docs/MCP.md table I kept the current text and explain why below. bun scripts/gate.ts --fix and tsc are clean. The tests in test/growth.test.ts, test/conversation-confirm.test.ts and test/mcp-doc-names-every-argument.test.ts pass. I haven't seen the forge's check on this push.
- Resume preview: it now says "The planner would be switched on." followed by the current state: "The planner is on now." or "The planner is paused until … (now)". Pause previews get the same current-state line. A test asserts the exact resume sentence, both when the planner is on and when it is paused.
- New tests:
- A preview without confirm is refused to an agent and to a non-admin.
- until together with resume is refused.
- A non-boolean confirm is refused.
- An unknown action is refused.
- A zoneless until is stored as UTC.
docs/features/growth.md: the "Not done" line is rewrapped as one paragraph.docs/MCP.mdtable (disagree):scripts/mcp-table.tsgenerates that row from every enum in the tool'sinputSchema, sopauseandresumeappear there on purpose. I edited the row by hand, regenerated, and the script put them back. A hand edit would be overwritten on the next run, so the table stays as generated. If you'd rather it list only kinds, the change belongs in the script.
The release hold on the desk is about production rolling and doesn't touch this change.
Earlier asks are met: the resume preview now names the current state, the refusal and validation tests are added, the growth.md Not-done line is rewrapped, and the MCP.md row stays as generated (the script derives it from the enums, so that is fine). The identity check (maySwitch) runs before any preview or act. The act goes through setPlannerSwitch, which records the events. Read-only tokens can only preview. The page keeps its sentences through SWITCH_REFUSED. The queue.ts change is a refactor with no new UI. The clone does not have c1212ec, so I read the change as given.
The MCP
systemtool now pauses and resumes the planner, with a preview first. I rantest/growth.test.ts,test/mcp-size.test.ts,test/mcp-write-scope.test.ts,test/mcp-table.test.tsandtest/mcp-growth.test.ts, plustsc,scripts/gate.tsandscripts/design-lint.ts; all pass. I did not run the full suite, which the forge runs on push.What changed
systemwith{ kind: "growth", repo, action: "pause" | "resume", until?, confirm? }. It is a new action on the existing tool, not a new tool, and the MCP size ceilings are untouched.confirm:trueit changes nothing and says what it would do.confirm:trueit callssetPlannerSwitch, the same function the page's switch calls, which recordsplanner.pausedorplanner.resumed.untilis a UTC time within a year. A pause withoutuntillasts until the planner is switched on.SWITCH_REFUSEDinsrc/actions/planner_switch.ts, and the queue page uses that same table.rotokens; only a confirmed pause or resume needsrw.docs/features/growth.mdloses the MCP Not-done line and describes the new action. I regenerated the tool table indocs/MCP.md. I added asystementry toWRITE_ARGSintest/mcp-write-scope.test.ts.Tests (in
test/growth.test.ts): one for the preview, one each for the agent and non-admin refusals, one for a bad time, and one for the confirmed pause and resume that checks both events are recorded.Not done: the repository-home panel and the other items on the existing Not-done line are untouched.
To try it: as the repository's owner, call
system {kind:"growth", repo:"owner/name", action:"pause"}, then repeat it withconfirm:true.Closes #13107