Skip to content

Plan mode upgrade: in-conversation plan tracker, one-click approval, and reasoning-effort tiers#29

Merged
Luhaozhu merged 1 commit into
mainfrom
feat/plan-mode-upgrade
Jul 25, 2026
Merged

Plan mode upgrade: in-conversation plan tracker, one-click approval, and reasoning-effort tiers#29
Luhaozhu merged 1 commit into
mainfrom
feat/plan-mode-upgrade

Conversation

@Luhaozhu

Copy link
Copy Markdown
Contributor

Summary

This PR upgrades plan mode along three axes and fixes a reasoning-leak bug uncovered along the way.

In-conversation plan tracker (update_plan)

The main agent now carries a lightweight update_plan tool. On complex multi-step tasks it lays out a step checklist before starting, keeps executing in the same turn (no redirect, no approval round-trip), and updates step states as it works. The checklist renders as a slim plan bar pinned above the chat input — with a determinate progress ring, the current step, and an expandable step list — instead of cluttering the message flow. Simple Q&A never triggers it.

One-click approval for manual plan mode

The plan preview card now ships Confirm / Discard buttons (typed confirmation still works as a fallback). The decision is reflected on the card, and execution progress is mirrored into the same plan bar.

Plan-Execute-Verify

Plan prompts now instruct the model to append a final verify-and-fix step whenever the task has checkable deliverables (generated files, code, data processing): open the artifacts, check them against the acceptance criteria, and fix problems in place rather than merely reporting them. Whether and how to verify is the model's call — nothing is hard-coded.

Fix: reasoning chain leaking into the answer

Hybrid reasoning models often omit the opening <think> tag after tool calls. The frontend stripper re-arms on tool results, but update_plan intentionally emits no tool events — so the next iteration's bare reasoning leaked into the visible answer. The stripper now also re-arms on plan_update events, and plan-step outputs strip orphan closing tags as a belt-and-braces measure.

Misc

  • Model providers gain a supports_reasoning_effort switch that unlocks High / Max thinking tiers per chat provider (delivered via chat_template_kwargs).
  • Community edition hides the admin tag on globally installed plugins (CE has no admin/user hierarchy).

Testing

  • End-to-end browser runs: manual plan mode (generate → button approval → execution → plan bar → completion), agent-initiated update_plan checklists across research/spreadsheet/slide tasks, and a negative control confirming simple questions don't trigger planning.
  • Reasoning-leak regression verified in high-reasoning mode on both the live stream and the reload/history path.
  • npm run build and backend import checks pass.

…d per-provider reasoning-effort tiers

- Add an update_plan tool for the main agent: on complex multi-step tasks it
  maintains a step checklist rendered as a slim plan bar above the chat input
  (Codex-style), keeps executing in the same turn, and marks steps completed
  as it goes; simple Q&A never triggers it
- Manual plan mode: the preview card now ships Confirm / Discard buttons
  (typed confirmation still works); decisions are reflected on the card
- Plan prompts now instruct the model to append a verify-and-fix step for
  tasks with checkable deliverables (plan-execute-verify), fixing issues
  in place instead of only reporting them
- Fix reasoning leak: re-arm the <think> stripper on plan_update events and
  strip orphan closing tags in plan-step outputs, so hybrid reasoning models
  that omit the opening tag no longer leak chain-of-thought into the answer
- Model providers: new supports_reasoning_effort switch unlocks High / Max
  thinking tiers per chat provider (sent via chat_template_kwargs)
- Community edition: hide the admin tag on globally installed plugins
@Luhaozhu
Luhaozhu merged commit d251d9e into main Jul 25, 2026
3 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