Repository navigation
refactor: extract and test permission pending check - #112
Merged
Merged
Conversation
Follow-up to #98: the inline pending-list probe becomes an exported isPermissionStillPending helper (fail-open on every lookup failure), the 300ms grace becomes a named constant, getPermissionIDFromEvent is exported, and the author's claimed decision matrix is now covered by tests against stub clients.
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.
Follow-up to #98 (review findings).
isPermissionStillPending(client, id)helper. Same fail-open semantics, one place instead of buried in the event handler.PERMISSION_PENDING_GRACE_MSconstant with a comment explaining why the wait exists (the event fires before the TUI/CLI auto-reply).getPermissionIDFromEventis exported like the other parse helpers.Review notes on #98 worth recording: the
permission.askplugin hook path needs no change. Core deleted its onlyPlugin.trigger("permission.ask")call in opencode@2fc06c5, so the event path #98 gates is the only live path; the hook handler stays as a legacy fallback for older servers.Checks: tsc clean, bun test 127 pass, bun build clean.