Skip to content

fix(web): stop auto-approving plan reviews and sensitive files in yolo mode - #1056

Merged
wbxl2000 merged 1 commit into
mainfrom
bug/web-yolo-approve
Jun 24, 2026
Merged

fix(web): stop auto-approving plan reviews and sensitive files in yolo mode#1056
wbxl2000 merged 1 commit into
mainfrom
bug/web-yolo-approve

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

No prior issue. Found by tracing a yolo-mode web session where a plan was approved without any user interaction.

Problem

In the web app, a session running in yolo permission mode had every approval request silently auto-approved, including requests the daemon intentionally sends for user confirmation: plan reviews (ExitPlanMode), sensitive-file access, .git control-path access, and goal starts. A plan could be approved within milliseconds without the user ever seeing it.

The cause was a client-side policy in the web app — a temporary "until the daemon exposes a permission endpoint" shim — that answered approved to every incoming approval request whenever the mode was auto or yolo. The daemon already resolves auto and yolo server-side: auto never emits an approval request, and yolo deliberately still asks for the sensitive cases above. The web shim overrode that intent. The TUI has no such shim and behaves correctly.

What changed

  • Removed the client-side auto-approve on incoming approval requests in the web event handler.
  • Removed the "auto-approve pending approvals on switching to auto/yolo" behavior in the permission-mode setter.

Any approval request that now reaches the web app is a genuine daemon ask and is shown to the user, matching the TUI and the daemon's permission policy chain. auto mode is unaffected because it never produced approval requests. The intended behavior is already covered by the daemon-side permission policy tests, so this PR adds no new web test.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

…o mode

The web app ran a client-side policy that auto-approved every approval request in auto/yolo mode, including plan reviews, sensitive file access, and other asks the daemon intentionally sends for user confirmation. The daemon already resolves auto/yolo server-side, so drop the client-side auto-approve and let those requests reach the approval UI.
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5cbbf69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@5cbbf69
npx https://pkg.pr.new/@moonshot-ai/kimi-code@5cbbf69

commit: 5cbbf69

@wbxl2000
wbxl2000 merged commit b93e936 into main Jun 24, 2026
9 checks passed
@wbxl2000
wbxl2000 deleted the bug/web-yolo-approve branch June 24, 2026 03:21
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
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