CodeWhale icon indicating copy to clipboard operation
CodeWhale copied to clipboard

plan and agent mode mixed up YET AGAIN plan 和 agent 模式混合的问题似乎仍然存在

Open DracheTek opened this issue 5 months ago • 7 comments

Description

本次上传的是一次具体的“AI没有感知到plan/agent切换”的实例,最后一段是我在plan模式下发送的,从thinking过程可以清楚看到agent尝试了多个常用的文件修改方法。

chat_export_20260625_102055.md

Steps to reproduce

在工作流中不定时地切换plan-agent,要求一些与功能进展相关的答复,可能就会出现此现象。

Expected behavior

给出具体方案,发散方案,或要求切换模式(根据方案的成熟程度)

Actual behavior

未经给出具体方案直接开始调用写文件工具

Impact

同上

Environment

  • OS: windows
  • codewhale version: 0.8.64
  • Install method: in-app update (codewhale update)
  • codewhale doctor summary:
  • Model/provider: deepseek-v4-pro
  • Terminal app: zed terminal
  • Shell: powershell

Logs, screenshots, or recordings

见附件文本

DracheTek avatar Jun 25 '26 02:06 DracheTek

Thanks @DracheTek for the report.

This issue is staying open for maintainer triage. CodeWhale gets better because people bring us real edge cases from real machines, providers, regions, and workflows.

If you can add a reproduction, logs, version output, screenshots, or the provider/model involved, that makes it much easier for us to verify and harvest the fix. Maintainers may comment /lgtmi to mark recurring issue reporters as approved so this intake note is skipped next time.

github-actions[bot] avatar Jun 25 '26 02:06 github-actions[bot]

我遇见的更严重一些,我的是一直在agent模式下面,但一直被识别成plan,疯狂的切换工具尝试完成我的任务,导致token被大量消耗。

Image

orz0219 avatar Jun 25 '26 10:06 orz0219

这个问题我也提过 状态不同步 #3279 , 现在codewhale 从0.8.50以后就变的不好用了. 最近几个版本特别严重. 我已经不得已暂时切换成其他工具了. 我在等待0.9的大规模重构以后在尝试一下

yekern avatar Jun 25 '26 12:06 yekern

Thanks @DracheTek for the concrete export, and thanks @orz0219 / @yekern for confirming related mode-desync symptoms.

A narrow fix for the edit-last-turn stale-mode path has landed on main in fa1e072ae2a1ec47d4684d5877b09e605c061c01 via PR #3592. The edited-turn resend now reuses the engine stored mode instead of forcing Agent mode (crates/tui/src/core/engine.rs:1650), and the regression switches to Plan, edits the last turn, and asserts the snapshot remains plan (crates/tui/src/core/engine/tests.rs:3172).

I am leaving this issue open because the thread also reports broader plan/agent state desync beyond that one resend path. Please add any fresh 0.8.65+ repros here; the landed fix should remove this specific /edit-after-mode-switch failure mode.

Hmbown avatar Jun 25 '26 22:06 Hmbown

Follow-up status: PR #3623 has now landed on main as 1494481b02cfff95c3c880cfe0206768e8625b55. That change adds the active mode and the canonical runtime mode policy into each user turn's <turn_meta> block, reusing the existing Plan/Agent/YOLO policy snippets. Local verification on the PR covered the #3568 Plan-mode failure shape with turn_metadata_includes_plan_mode_policy, the broader plan_mode filter, and a codewhale-tui check; GitHub CI was green before merge.\n\nI am still leaving this issue open for reporter retest because the thread includes multiple mode-desync reports, not only the already-fixed edit-last-turn stale-mode path (#3592) and the now-landed model-facing mode-policy metadata path (#3623). Fresh 0.8.65+ repros should go here if Plan/Agent/YOLO still drift in a normal turn.

Hmbown avatar Jun 26 '26 02:06 Hmbown

Follow-up: PR #3663 has now landed on main as 994086ea4f28e9f54e4e54703eb3a1b88eb0215f. This covers another concrete mode-desync path: restored/reloaded sessions now carry the active AppMode through SyncSession, and the engine applies that mode when it syncs session state (crates/tui/src/core/engine.rs:1591-1618; UI send sites include crates/tui/src/tui/ui.rs:813-823 and crates/tui/src/tui/ui.rs:3031-3040). It also adds the regression sync_session_restores_current_mode (crates/tui/src/core/engine/tests.rs:3180).

Thank you @cyq1017 for the focused fix and regression coverage, and thank you @DracheTek, @orz0219, and @yekern for the concrete reports and confirmations. I am keeping this open for fresh retesting because the thread covers broader Plan/Agent/YOLO desync symptoms beyond this newly fixed restored-session path.

Hmbown avatar Jun 27 '26 05:06 Hmbown

Thank you guys for raising this. I'm still out of town so not able to fix it immediately but will fix this asap as it's impacted my own usage as well. I really appreciate you all helping me by making the issue so clear.

Hmbown avatar Jun 28 '26 14:06 Hmbown