fix(cli): harden ask and plan modes#9556
Merged
alex-alecu merged 14 commits intomainfrom Apr 29, 2026
Merged
Conversation
Contributor
Author
|
Manual test passed. Tested:
Verified:
|
Contributor
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments: None. Files Reviewed (12 files)
Reviewed by gpt-5.4-2026-03-05 · 2,314,133 tokens |
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.5-2026-04-23 · 1,732,752 tokens |
Contributor
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
Contributor
Author
|
Manual test passed. Tested:
Verified:
|
| session: Pick<Session.Info, "permission"> | ||
| }) { | ||
| const rules = input.session.permission ?? [] | ||
| if (!["ask", "plan"].includes(input.agent.name)) return rules |
Contributor
There was a problem hiding this comment.
Consider moving this to a const at the top, and use it here and in hardPermissions()
imanolmzd-svg
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Fixes #9278
Ask and Plan modes could still change files before the user chose to build. That made it possible for the assistant to start editing when the user only wanted an answer or a plan.
What changed
The app now blocks file changes in Ask mode and only lets Plan mode write its plan. Extra saved permissions can no longer turn those edits back on. Shell commands that try to write through output redirects are blocked. When a plan is finished, the assistant stops right away and waits for the user to choose what happens next.
How to test
echo bug > ask-bug.txt; verify no file is created.packages/opencode/, runbun test test/kilocode/ask-agent-permissions.test.ts,bun test test/agent/agent.test.ts, andbun test test/session/prompt-effect.test.ts.