MoonshotAI / MoonshotAI/kimi-cli
[Bug] ExitPlanMode reports "Not in plan mode" while system reminder claims plan mode is active / Plan mode 狀態不一致
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.4k
- Forks
- 1.3k
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 2
Description
Problem Description
While the system reminder explicitly says "Plan mode is active" and provides a plan file path, calling ExitPlanMode returns:
Not in plan mode. ExitPlanMode is only available during plan mode.
This makes it impossible for the assistant to exit plan mode normally. The workaround is to call EnterPlanMode again and then ExitPlanMode.
User also reported that after running /fork, plan mode can be exited normally.
Reproduction Steps
- Trigger plan mode (e.g. via
/initorEnterPlanMode). - Write the plan to the designated plan file.
- Call
ExitPlanMode. - Observe the error:
Not in plan mode. - Call
EnterPlanModeagain. - Call
ExitPlanModeagain — now it works.
Expected Behavior
When the system reminder shows plan mode as active and the plan file exists, ExitPlanMode should recognize the state and enter the user-approval flow.
Environment
- Kimi Code CLI
- Plan mode triggered after
/init
Workaround
- Run
/forkto create a new session, then plan mode exits normally. - Alternatively, call
EnterPlanModeagain beforeExitPlanMode.
問題描述
系統 reminder 明確顯示「Plan mode is active」並給出 plan file 路徑,但呼叫 ExitPlanMode 時卻回傳:
Not in plan mode. ExitPlanMode is only available during plan mode.
這導致助手無法正常退出 plan mode,必須重新呼叫 EnterPlanMode 後再 ExitPlanMode 才能恢復。
使用者回報執行 /fork 後即可正常退出。
復現步驟
- 觸發 plan mode(例如透過
/init或EnterPlanMode)。 - 將 plan 寫入指定的 plan file。
- 呼叫
ExitPlanMode。 - 觀察錯誤:
Not in plan mode。 - 再次呼叫
EnterPlanMode。 - 再次呼叫
ExitPlanMode—— 此時成功。
預期行為
當系統 reminder 顯示 plan mode active 且 plan file 已存在時,ExitPlanMode 應正確識別狀態並進入使用者審批流程。
環境
- Kimi Code CLI
- 透過
/init進入 plan mode
變通方案
- 執行
/fork建立新會話後可正常退出。 - 或者先呼叫
EnterPlanMode再呼叫ExitPlanMode。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the EnterPlanMode and ExitPlanMode entry points, including how /init and /fork affect session state and the system reminder. Reproduce the documented sequence and compare the active state with the ExitPlanMode check. Done means ExitPlanMode recognizes the active plan and reaches the user-approval flow without requiring EnterPlanMode again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100