Add a `planning` built-in to Pax that keeps a todo plan per conversation
- Part of #14763
Adds planning, a Pax built-in that binds harness Planning with a plan per saved conversation and draws the plan in the terminal when it changes. Declared by hand today, Planning keeps its plan in memory for one run, so the plan was gone on the next prompt.
- Off by default (
/plugins enable planning).Planningadds six tools and a short instruction to every request, andcoderhas no todo tool of its own, so turning it on is a prompt change each user should choose. - Storage: a
SqlitePlanStoreinplan.dbbesidesessions.db, one plan per conversation ID, created owner-only likesessions.db./resumeand--resumebring the plan back. Deleting a conversation (in/resumeorhost.sessions.delete) or claiming an explicit unused ID (--session-id,Session.clear(id), or--fork-session --session-id) fires a shell-ownedConversationDeletedmoment (Plugin.on_conversation_deleted) soPlanningPluginclears that conversation's rows inplan.dbwithout coupling coreSessionsto plugin storage./newstarts with none. A fork (/fork,--fork-session, or a busy conversation resumed as a copy) also starts with none: its copied history still shows the old plan, so on its next requestPlanningrecords that the plan is now empty, and the model plans again from there. Runs under another conversation ID, such as a delegated task, keep their plan in memory for that run, so they write nothing toplan.db. Plans are keyed by conversation, so concurrent live sessions never share one. - Panel: after a plan tool changes the plan (any
PlanCreatedEvent,PlanUpdatedEventorPlanDeletedEvent; a status change is always an update), Pax draws the whole plan once, under that tool's row, whether the model called it directly or from insiderun_code:ādone,ā¼in progress (by its present-tense label),ā»pending,ācancelled,!blocked. Done and cancelled steps are struck through.read_plan, and calls that change nothing, draw nothing. Step text goes throughterminal_text, so a model-written line break cannot forge a row. - Web UI: not drawn there yet. The browser renders events in its own TypeScript client, so that is a follow-up.
Docs: a "Planning" section in docs/reference.md, the built-ins table in PLUGINS.md, the README and docs/harness/pax.md plugin lists, FILE_MAP.md, and the harness planning README in pax_docs._HARNESS_DOCS.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.
š¤ Generated with Claude Code
Summary by cubic
Adds a planning built-in to Pax that keeps a todo plan per saved conversation and draws it in the terminal whenever a plan tool changes it. Previously Planning was only declarable by hand and its plan lived in memory for one run, so it was gone on the next prompt.
- Off by default (
/plugins enable planning): it adds six plan tools and a short instruction to every request. - Stores one plan per conversation in an owner-only
plan.dbbesidesessions.db;/resumebrings it back,/newand forks start with none. Runs under another conversation ID, such as a delegated task, keep their plan in memory. - Adds an
on_conversation_deletedplugin hook: deleting a conversation firesConversationDeleted(reason='deleted'), and claiming an explicit unused ID (via--session-id,Session.clear, or a fork with an explicit ID) firesreason='reused'. Startup claims are deferred until plugins load, soplanningclears any stale plan without a pre-load race. - Draws the whole plan under the calling tool's row on change (
āā¼ā»ā!);read_planand no-op calls draw nothing. Panel state is scoped per run and cleared when the run ends; a delegated run starting mid-turn leaves the parent's panel intact. - The web UI does not draw the plan yet; that's a follow-up.
- Adds two API-compatibility waivers against v2.78.0, folding
detect_loopsinto theplanningone and adding one forConversationDeleted.planningbinds harnessPlanningonly after enablement, so saved declarations stay declared.