Repository navigation
fix(models): wait for catalog publication during API-key saves - #176195
Conversation
Retry only a direct pending-publication refusal before credential writes or configuration preparation. Reuse the credential owner settlement wait and preserve revocation, unknown outcomes, overrides, and cleanup failures.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesAPI-key saves wait for pending credential publication and retry only operations refused before writing. Example: Saving sample:manual while a catalog refresh begins inside credential-write preparation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current API-key save failure, preserves the existing authority boundaries, and has no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherModels and the CLI share an API-key save owner that validates credential authority, persists the key, and applies its provider binding through the configuration writer. flowchart TD
A[Models or CLI] --> B[Shared API key save]
B --> C[Credential authority]
D[Catalog publication] --> C
C --> B
B --> E[Credential writer]
B --> F[Configuration writer]
F --> G[Gateway provider binding]
Technical reviewBest possible solution: Land the focused repair using the existing publication waiter, pre-write validation, and separate configuration application. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the pre-write failure ordering, and the PR reports a failing baseline regression plus macOS and Linux Gateway reproductions; this review executed no target code. Is this the best way to solve the issue? The patch is the smallest complete repair supported by the inspected owners: distinguish temporary publication refusal, release the refused operation before waiting, then retry with current authority while preserving cleanup failures and committed-write semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1507c89eaa51. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +23, Tests +99. Total +122 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 7:51 AM ET / 11:51 UTC. |
|
Merged via squash.
|
…law#176195) Retry only a direct pending-publication refusal before credential writes or configuration preparation. Reuse the credential owner settlement wait and preserve revocation, unknown outcomes, overrides, and cleanup failures.
What Problem This Solves
Fixes API-key saves that fail when a model-catalog refresh begins while the credential store is preparing the write.
User Impact
Saving a key waits for an in-flight credential publication to settle, then revalidates authority before writing. Unknown publication outcomes, revoked callers, retired owners, and agent overrides still reject the save.
Why This Change Was Made
Follow-up to #176166, found while checking #175837. Waiting during initial preparation and configuration application did not cover a new catalog publication beginning before the asynchronous credential-store updater called its validation callback.
The credential owner distinguishes that temporary pending state from unavailable authority and supplies its existing settlement wait. The save retries only the refused pre-write operation and separately validates configuration. A committed key is never replayed. Synchronous authority checks remain in place.
Evidence
models.authSetApiKeyrejected during its pre-write callback after the model-catalog worker began a credential batch. The captured root/source identities remained current; neither outcome was unknown. Instrumentation was removed after diagnosis.f585b0421821) with the same authority error and zero committed key writes. The repaired auth API-key suite passes all 46 cases, including settlement, unknown results, owner closure, revoked callers, competing overrides, and cleanup-error propagation. The complete file took 173s including preparation on the shared worker; the new failing baseline case took 2.6s.Production delta: +93/−70 lines (net +23); tests: +148/−49 (net +99). Existing publication waiters and synchronous effect checks remain the only owners.