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.
Part of #8364. Sibling of #8510.
Plan mode is user-driven today: the toggle in the Expert chat input (
ff-toggle-switch,ExpertChatInput.vue) flipsplanModeinproduct-expert.jsviasetPlanMode(), andcontext.jssends it to the agent each turn. The Expert cannot enter plan mode itself.Add a frontend
ui_toolui_set_plan_mode(likeui_set_onboarding_phase), audienceexpert, whose handler callssetPlanMode(enabled)with a requiredenabledboolean argument, the same action the toggle uses. The switch visibly moves and the next turn'scontext.jsreports the newplanMode. 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
audience: expertui_tool sets plan mode by callingsetPlanMode()with anenabledboolean.