fix(rust): isolate GitHub token callbacks from request routing - #2567
Open
xianjianlf2 wants to merge 1 commit into
Open
fix(rust): isolate GitHub token callbacks from request routing#2567xianjianlf2 wants to merge 1 commit into
xianjianlf2 wants to merge 1 commit into
Conversation
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 #2424.
A pending GitHub token callback currently holds up the single Rust request-routing loop; a callback panic terminates that loop without replying. Give each token-provider registration a lazy FIFO worker so other providers and session requests can continue while preserving callback order within a registration. Catch callback panics and return an internal RPC error without including the panic payload.
The registration owns and aborts its worker on retirement. Workers retain a weak client reference, so pending callbacks do not keep the client alive. No public API or protocol changes.
Three regression tests exercise blocked-provider isolation (including same-provider FIFO and an unrelated user-input request), panic recovery, and cancellation on session deletion, force-stop, and dropping session/client handles. The blocking and panic tests fail on the base commit.
Validation:
test-support,bundled-in-processand the repository's strict warning flags passed.git diff --checkpassed.Validation used
COPILOT_SKIP_CLI_DOWNLOAD=1; live CLI/provider E2E tests were not run. No new dependencies. Codex assisted with implementation and validation.