fix(cli): keep subagents running after permission denial - #13744
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
marius-kilocode
enabled auto-merge
September 3, 2026 12:00
WebReflection
approved these changes
Sep 3, 2026
This was referenced Sep 6, 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.
What Problem This Solves
Denying a tool permission inside a subagent, such as a read of
.env, stops the entire child loop before it can finish exploration or return its findings. The parent can receive an empty task result and repeat the work.Why This Change Was Made
The processor treats a rejected tool call as a session stop signal. Limit that stop behavior to root sessions. A child still records the denied tool as an error, but gets another model turn to use permitted tools and report its findings. This is a one-line runtime change; permission rules, root-session continuation settings, question dismissal, and cancellation are unchanged.
User Impact
Deny access to a file without losing the subagent exploration. The denied operation is not allowed, retried, or replaced with a successful result by the runtime.
Evidence
.envread, and never reached the next permitted read.continue_loop_on_denybehavior..env, complete the next permitted read, return findings to the parent. The dummy secret was absent from all provider requests. No real credentials or model calls were used.Manual check: deny a subagent
.envread, then confirm it continues with permitted files and returns a summary.VS Code self-test
Reproduced both versions in the real sidebar with a disposable workspace, isolated VS Code profile, isolated Kilo storage, and a local scripted provider. The model responses were scripted; the task tool, permission dialog, Deny button, session loop, and returned task results were real.
.envread. The child stops after two read attempts and the parent receives an empty task result.after.txtread and returns its findings. The dummy secret is absent from all provider requests.Before / after: