fix: waiting for approval when creating rules#260
Merged
virattt merged 6 commits intoMay 12, 2026
Conversation
Contributor
Author
|
@virattt ready for review :) |
swrzalek
commented
May 12, 2026
| /** | ||
| * Helper to create an AgentRunnerController with a change counter | ||
| */ | ||
| function createController(onChange?: () => void) { |
Contributor
Author
There was a problem hiding this comment.
we can also create test-utils. I am open.
Owner
|
Also fixes: #266 |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Fix approval prompt not rendering when creating rules
Problem
When the agent requested approval for file-modifying tools (e.g.,
write_fileto create.dexter/RULES.md), the CLI showed "Waiting for approval..." but never rendered the actual approval overlay with selectable options. Pressing Enter had no effect because the approval prompt was never displayed.Root Cause
renderSelectionOverlay()was only called from the model selection callback and startup — never from the agent runner'sonChange. When the agent entered approval state, the working indicator updated but the overlay wasn't triggered.Fix
Added
lastPendingApprovalstate tracking in theonChangecallback (src/cli.ts). WhenpendingApprovaltransitions (enters or exits),renderSelectionOverlay()is now called to properly show/hide the approval overlay.Tests
Added 12 unit tests in
src/controllers/agent-runner.test.tscovering:onChangefiring during approval state changescancelExecutionbehaviorFiles Changed
src/cli.ts- TrackpendingApprovalchanges and trigger overlay renderingsrc/controllers/agent-runner.test.ts- 12 new tests for approval state managementResolves: #245