MoonshotAI / MoonshotAI/kimi-code
ACP reports default mode while the engine uses auto or yolo permissions
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What version of Kimi Code is running?
Current main at 911d41b0f6aa83ef08b2ee5fe8d055218c0951b2.
Which open platform/subscription were you using?
Not provider-specific.
Which model were you using?
Not model-specific.
What platform is your computer?
All platforms; this is in the native ACP session state projection.
What issue are you seeing?
The native ACP server reports every newly activated session as default mode even when the engine is actually running with auto or yolo permissions.
AcpSession initializes currentModeId to default. During init(), it restores the model and thinking level from the engine, but it never reads the current permission or plan state. As a result, both of these response fields can disagree with the mode that governs tool execution:
modes.currentModeId- the
modeconfig option'scurrentValue
This is especially misleading for permission-sensitive IDE UI: the client can display the Default/manual-approval mode while tool calls are actually being auto-approved by the engine.
What steps can reproduce the bug?
-
Set the following in
~/.kimi-code/config.toml:default_permission_mode = "yolo" -
Start
kimi acpand sendinitializefollowed bysession/new. -
Inspect the
session/newresult. -
Observe that
modes.currentModeIdand themodeconfig option both reportdefault. -
The main agent is nevertheless using the configured
yolopermission mode.
The same mismatch occurs when loading or resuming a session whose persisted permission mode is auto or yolo.
What is the expected behavior?
ACP should derive the initial mode from the live engine state before returning from session/new, session/load, or session/resume:
- active plan state →
plan - manual permission state →
default - auto permission state →
auto - yolo permission state →
yolo
The first-class modes state and the mode config option should always agree.
Additional information
The Klient agent facade currently exposes setPermission() and getPlan(), but not a permission getter. A focused fix could expose the current permission mode through the existing engine service/facade boundary, then seed AcpSession.currentModeId together with the other engine-backed state during init().
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 with AcpSession.init() and trace how session/new, session/load, and session/resume seed engine-backed state. Inspect the Klient facade's setPermission() and getPlan() boundary to determine where the current permission mode can be read. Done means modes.currentModeId and the mode config option reflect plan, default, auto, or yolo consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100