Repository navigation
fix(plugins): honor provider runtime cache invalidation - #139908
Conversation
Use the canonical registry loader cache for unprepared provider hook lookup. Remove duplicate config/default caches that retained old hook owners after explicit runtime discovery invalidation, along with their unused synchronous config-cache helper. Preserve prepared generation and loaded registry precedence, alias/model ownership, and current per-call profile context. Production LOC: -151. Verified 107 owner/sibling tests, real generated-provider filesystem RED and GREEN, the complete changed-file gate, and independent P2 review.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 4:01 AM ET / 08:01 UTC. ClawSweeper reviewWhat this changesProvider hook selection now reuses the registry loader’s cache so explicit discovery refreshes affect subsequent lookups, while prepared handles retain their selected plugin. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still retains the provider caches that bypass runtime-discovery invalidation. No blocking defect was found, and the prior draft-status blocker is resolved. Priority: P2 Review scores
Verification
How this fits togetherProvider runtime lookup selects plugin hooks from provider names, model ownership, configuration, and plugin metadata. Those hooks guide authentication, model handling, and inference; prepared attempts retain their selected provider. flowchart TD
A[Provider and model request] --> B{Prepared handle available?}
B -->|Yes| C[Retain selected plugin]
B -->|No| D[Generation or loaded registry]
D -->|Discovery needed| E[Registry loader cache]
F[Explicit discovery invalidation] --> E
C --> G[Invoke hook with current context]
D -->|Provider found| G
E --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -151, Tests +39, Docs +6, Other 0. Total -106 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep registry reuse under the loader’s invalidation owner while preserving attempt-scoped provider selection and current per-call inputs. Do we have a high-confidence way to reproduce the issue? Yes, from source: repeat an unprepared lookup with unchanged configuration and plugin IDs after refreshing the package entry and invalidating discovery; current main can return the old cached provider. This review did not execute that path. Is this the best way to solve the issue? Yes. Removing the redundant cache makes existing loader invalidation effective without adding another invalidation mechanism or changing the provider API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 83d1f53c51a2. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…39908) Use the canonical registry loader cache for unprepared provider hook lookup. Remove duplicate config/default caches that retained old hook owners after explicit runtime discovery invalidation, along with their unused synchronous config-cache helper. Preserve prepared generation and loaded registry precedence, alias/model ownership, and current per-call profile context. Production LOC: -151. Verified 107 owner/sibling tests, real generated-provider filesystem RED and GREEN, the complete changed-file gate, and independent P2 review.
What Problem This Solves
Resolves a problem where provider preparation could keep selecting old plugin hooks after runtime discovery was explicitly refreshed, when the plugin kept the same ID and configuration. Updating the package entry could leave auth or model behavior attached to the previous owner.
Why This Change Was Made
The registry loader now owns provider lookup reuse, so its existing invalidation also governs subsequent hook selection. This removes duplicate config/default caches and their unused helper while preserving prepared-generation, loaded-registry, alias and model-owner selection. Production code decreases by 151 lines.
User Impact
Unprepared provider lookups follow refreshed metadata after runtime-discovery invalidation. Existing prepared handles and generations retain their selected provider, with current context supplied to each hook call.
Evidence
The filesystem probe uses synthetic local state and profile identifiers. It does not claim Gateway reload, external authentication/inference, or new callback-revocation behavior.
Related: #135599. This is an independently landable provider-owner cleanup from that lifecycle work.