Skip to content

code-mode: make all approvals trigger elicitation pause - #31650

Merged
cconger merged 2 commits into
mainfrom
cconger/code-mode-approval-elicit
Jul 8, 2026
Merged

code-mode: make all approvals trigger elicitation pause#31650
cconger merged 2 commits into
mainfrom
cconger/code-mode-approval-elicit

Conversation

@cconger

@cconger cconger commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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_*_approval methods 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.

@cconger
cconger requested a review from a team as a code owner July 8, 2026 21:25
grant_root: Option<PathBuf>,
) -> oneshot::Receiver<ReviewDecision> {
) -> ReviewDecision {
let _elicitation = self.services.elicitations.register();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we returning object if not using it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holding the object keeps the "lock", its when we return and drop it that the pause counter is decremented.

@cconger
cconger force-pushed the cconger/code-mode-approval-elicit branch from de81b1b to 44e0993 Compare July 8, 2026 22:07
@cconger
cconger merged commit c55cb4b into main Jul 8, 2026
35 checks passed
@cconger
cconger deleted the cconger/code-mode-approval-elicit branch July 8, 2026 22:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants