Repository navigation
feat(cli): continue run after rejecting a permission ask - #51968
Merged
Merged
Conversation
This was referenced Sep 29, 2026
3 of 6 tasks
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.
Type of change
What does this PR do?
opencode runhas nobody to approve permission asks. Today it rejects the ask, interrupts the session and exits 1. The model never gets to react.Now, outside V1 compatibility mode,
runrejects the ask with feedback (permission.replywithdecision: "reject"and amessage) and does not interrupt. Core already turns a reject-with-message intoPermission.CorrectedError, so the tool fails with model-visible output and the model continues in the same turn. The run then ends normally, with an exit code that reflects the final outcome.--autois unchanged: it approves once.denyrule is unchanged: the tool is blocked and the model continues.Core fix included:
toSessionErrorhad no case forPermission.CorrectedError, whosemessageis empty. Tools that wrap permission failures, likeread("Unable to read .env"), replaced the feedback with their generic message, so a rejection with feedback never reached the model. That also affects the TUI's reject-with-feedback. It now maps topermission.rejectedwith the feedback text, likeBlockedError.How did you verify your code works?
packages/cli:bun typecheck;bun test test/runis 11 pass / 0 fail.packages/core:bun typecheck;bun test test/session-runner.test.ts test/permission.test.ts test/session-error.test.tsis 333 pass / 0 fail..env), checking whether the file's contents or the feedback reached the model:Checklist