Repository navigation
fix(subagent): apply the latest wrap's sources on continuation OAuth refresh - #1397
Merged
TheGreatAxios merged 1 commit intoOct 12, 2026
Conversation
TheGreatAxios
deleted the
cl-10510-continuation-oauth-refresh-ignores-updated-sources-after-director-re
branch
October 12, 2026 00:54
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.
Bug
withContinuationOAuthRefresh(src/subagent/refresh-inference-source.ts) caches its proxy inwrappedDirectorskeyed only by the inner director. The cached-proxy fast path returned before readingoptions, and thedecideclosure captured the first wrap'soptions.sources/defaultSource. A second wrap of the same director with a different source set was silently dropped, so the continuation OAuth refresh ran against the stale source set.Repro evidence
src/subagent/refresh-inference-source.cache.test.ts(authored first, failing on current code) wraps one inner director with options A then options B, triggers a continuationdecide(), and asserts the agent receives B's sources. Before the fix:After the fix the test passes along with the existing suite (14 tests across the two files).
Fix
Keep the single proxy per inner director (one entry, no cache-key explosion), but store the latest options in the
WeakMapentry and refresh them on re-wrap, sodecide()readsentry.optionsat call time andrefreshInferenceSourceBundle(options.sources, options.defaultSource, options.catalog)always uses the current wrap's options.Fixes CL-10510
Related: CL-9483, CL-9484