code-mode: make all approvals trigger elicitation pause - #31650
Merged
Conversation
aibrahim-oai
reviewed
Jul 8, 2026
| grant_root: Option<PathBuf>, | ||
| ) -> oneshot::Receiver<ReviewDecision> { | ||
| ) -> ReviewDecision { | ||
| let _elicitation = self.services.elicitations.register(); |
Contributor
There was a problem hiding this comment.
why are we returning object if not using it?
Contributor
Author
There was a problem hiding this comment.
Holding the object keeps the "lock", its when we return and drop it that the pause counter is decremented.
aibrahim-oai
approved these changes
Jul 8, 2026
cconger
force-pushed
the
cconger/code-mode-approval-elicit
branch
from
July 8, 2026 22:07
de81b1b to
44e0993
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
summary
We want to pause code-mode from yielding back to the model when a subcommand triggers an approval prompt. This means that all of these previously inline blocking requests should also take out a ElicitationService registration.
This also does some plumbing refactoring to request patch approval to make it match the other
request_*_approvalmethods in that it blocks on the approval in the function instead of returning the oneshot channel, this affords our ability to encapsulate the ElicitationService registration via RAII.Adds tests to confirm the blocking behavior for code_mode both in suite tests and that the session holds them.