Give the Expert a tool to toggle plan mode
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
Part of #8364. Sibling of #8510.
Plan mode is user-driven today: the toggle in the Expert chat input (`ff-toggle-switch`, `ExpertChatInput.vue`) flips `planMode` in `product-expert.js` via `setPlanMode()`, and `context.js` sends it to the agent each turn. The Expert cannot enter plan mode itself.
Add a frontend `ui_` tool `ui_set_plan_mode` (like `ui_set_onboarding_phase`), audience `expert`, whose handler calls `setPlanMode(enabled)` with a required `enabled` boolean argument, the same action the toggle uses. The switch visibly moves and the next turn's `context.js` reports the new `planMode`. This is a general Expert improvement, and it gives onboarding its two-phase sequence: provision with plan mode off, then turn it on to build.
Older platforms without the tool: the Expert discovers tools via search and will not call what is not advertised, so it degrades gracefully and the user can still toggle by hand.
### Done when
* A frontend `audience: expert` `ui_` tool sets plan mode by calling `setPlanMode()` with an `enabled` boolean.
* Enabling or disabling it moves the visible toggle, and the next turn's context reflects it.
* When the tool is not advertised (older platform), the Expert proceeds without it rather than erroring.
Contributor guide
Assessment
This issue has not been assessed yet.