Skip to content

feat: plan before long work, that starts by itself - #265

Merged
httpsphl merged 4 commits into
mainfrom
feat/plan-first
Oct 25, 2026
Merged

httpsphl merged 4 commits into
mainfrom
feat/plan-first

Conversation

@httpsphl

Copy link
Copy Markdown
Owner

A bot can show its plan before long work, and starts by itself unless the owner steps in (spec 10.5). The idea comes from looking at how other agent workspaces handle it; the design and the code are our own.

What changes

  • show_plan MCP tool: a summary, 2 to 8 steps and an optional smaller way. It goes through the approvals path but waits only 20 s and does not put the bot in needs_approval. Start now, Do only this (the smaller way), Change (with a note) or Cancel; with no answer, the bot starts.
  • Per-bot switch: "Show the plan before long tasks" in the agent's edit dialog (bots.plan_first, migration 0031, bots.update { planFirst }). Only bots with it on get the "Show your plan first" section in their rules; switching restarts the bot once idle. Off, or in plan mode, the tool returns at once without a card.
  • App: a card with the steps and a countdown; the tool line is hidden like ask_owner's; the sidebar says "Plan: …" instead of "Waiting for approval". The phone reads the plan as one text and may answer it.
  • The chief's and the plan rule sections moved to workspace/sections.rs (files.rs was over 300 lines).
  • Also carries the spec 19 row for the edit diffs checked with the real Claude Code (feat(chat): show the lines each edit adds and removes, with its diff #264).

Checks

  • cargo fmt, clippy -D warnings, cargo test --workspace (new tests/plan_first.rs, plan and phone unit tests).
  • pnpm check: one run had phone/client.test.ts fail on timing under load; it passes alone (16/16) and this PR does not touch it.
  • Seen in pnpm dev: the card on Writer, "Do only this", the answered line and the sidebar line.

Manual test with the real Claude Code

  1. Turn on "Show the plan before long tasks" for a bot and wait until it restarts.
  2. Ask for something long ("rewrite the README in three sections and update the docs"): the card should come before any other tool, with the steps in your language.
  3. Leave it alone: after 20 s it reads "Started by itself" and the bot works.
  4. Ask again and press Change with a note: the bot should not start the old plan and should do what the note says.
  5. Ask a quick question: no card.

- With "show the plan first" on (bots.plan_first, migration 0031,
  bots.update { planFirst }), the bot's rules ask it to call show_plan
  before long work: a summary, 2 to 8 steps and an optional smaller way.
- The card goes through the approvals path but waits only 20 s and does
  not put the bot in needs_approval: start now, do only the smaller way,
  change (with a note) or cancel; with no answer the bot starts.
- Off, or in plan mode, the tool answers at once without a card. The
  phone reads the plan as one text and may answer it.
- The chief's and the plan rule sections move to workspace/sections.rs.
- Spec 10.5 describes it.
- StartPlanCard shows the summary, the numbered steps and the smaller
  way, counts down to the start, and offers Start now, Do only this,
  Change and Cancel. Answered, it is one line with the plan a click away.
- The show_plan tool line is hidden like ask_owner's: the card says it.
- The sidebar reads "Plan: ..." instead of "Waiting for approval".
- The agent's edit dialog has "Show the plan before long tasks".
- Texts in English, Portuguese and Spanish; a plan seeded for pnpm dev.
@httpsphl

Copy link
Copy Markdown
Owner Author

Checked with the real Claude Code 2.1.309 (dev daemon in its own folder, Sonnet, Manual mode, option on):

  • Long request: after the ToolSearch that loads the Botloft tools, the first tool was show_plan, with a summary and five steps in Portuguese.
  • Left alone: the card expired after 20 s, and the bot followed the plan (wrote, reviewed and shared the files).
  • Change with a note: the bot did not start the old plan and did what the note said.
  • Quick question: no card.
  • The daemon log kept no message or plan text.

Not seen yet: the bot offering an alternative on its own (neither plan had one), and the card in the installed app. Recorded in spec 19.

@httpsphl
httpsphl enabled auto-merge October 25, 2026 04:08
@httpsphl
httpsphl merged commit 5540c10 into main Oct 25, 2026
4 checks passed
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.

1 participant