fix: Enter/Escape work on subagent permission dialogs#50
Merged
Conversation
The permission pass-through check only looked at the current session's permissions/questions via api.state.session.permission(sid). When a subagent (child session) requested permission, it was stored under the child's session ID, so vimcode kept consuming Enter/Escape instead of letting them reach the permission dialog. Now uses api.event to track permission.asked/permission.replied events globally, aggregated by root session ID. The intercept checks both the direct session state and the event-tracked child prompt counter. Fixes #47
9d42a1a to
a519b96
Compare
ac55e8a to
09db046
Compare
09db046 to
2877ec3
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 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.
Fixes #47
Permission dialogs from child sessions (subagents) swallowed Enter and Escape because the pass-through only checked the current session ID. Subagent permissions live on a different session ID.
Now subscribes to
permission.asked/permission.repliedevents to track prompts from any child session, keyed by the root session. The intercept passes all keys through when the counter is non-zero.