Repository navigation
fix: stop OAuth fallback after catalog discovery times out - #139924
Conversation
|
🦞👀 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:52 AM ET / 08:52 UTC. ClawSweeper reviewWhat this changesStops model discovery from starting another account’s OAuth refresh after timeout while allowing an already-started token rotation to finish. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still permits OAuth preparation to advance after discovery times out. No introduced correctness defect was found, and the updated evidence resolves the previous validation hold. Priority: P2 Review scores
Verification
How this fits togetherModel discovery prepares credentials from configured accounts before asking provider plugins for available models. Its timeout controls which preparation and catalog results may contribute to the published inventory. flowchart TD
A[Configured accounts] --> B[Catalog timeout owner]
B --> C{Discovery still active?}
C -->|Yes| D[Prepare selected credential]
D -->|Failed candidate| C
D --> E[Persist completed token rotation]
E --> F{Discovery still active?}
F -->|Yes| G[Provider catalog and model inventory]
C -->|No| H[Stop further preparation]
F -->|No| H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +88. Total +96 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep deadline admission with the catalog owner and token persistence with the existing refresh owner, preserving fallback while discovery remains active. Do we have a high-confidence way to reproduce the issue? Yes, from source: let account A’s refresh fail after the catalog timeout while account B remains eligible; main’s unconditional loop then attempts B. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing lifecycle flag closes the preparation gap without adding settings, changing plugin contracts, or interrupting rotation persistence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 208aab3aa6f0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Fixed: catalog discovery no longer starts another OAuth refresh after its timeout. |
Merge verified main c5a7231, including openclaw#139997 on-demand SDK aliases and openclaw#139924 catalog timeout ownership. Preserve the Bedrock runtime, fixture and LLM export bytes. Documentation retains the existing scheduler guidance alongside disjoint main updates. The prior Bedrock HTTP and build checks passed; shared ACP cleanup and literal OAuth discovery failures require these canonical owner fixes. A fresh exact-head CI run follows this reviewed integration. Co-authored-by: Lucas Cardoso <[email protected]>
…139924) Stop OAuth fallback after catalog discovery times out while allowing an in-flight credential refresh to finish safely. Refs openclaw#137033.
Related: #137120
Additional instructions
This PR uses a branch in
openclaw/openclaw.What Problem This Solves
Fixes an issue where users waiting for model discovery could have additional
accounts' OAuth credentials refreshed in the background after discovery had
already timed out. This happened when the first account's pending refresh later
failed and preparation advanced to the next candidate.
Why This Change Was Made
The catalog timeout already suppressed late catalog results, but its preparation
loop could not observe that discovery had ended. Carry the existing owner's
liveness state into that loop and close admission when the timer fires.
An already-started refresh is allowed to finish and persist its rotated token.
Normal fallback before timeout, account ordering, failure-outcome semantics and
provider SDK contracts are unchanged.
User Impact
Model discovery stops starting additional account refreshes after its timeout.
Late preparation still cannot start the catalog hook, while an in-progress token
rotation can finish safely. No configuration changes are required.
Evidence
Validated head:
4af27929a0718f0077eeedf57884172139528333.9e5bb4a3ecd03772156fdbf3201ab54af5c6be98because A's late failure starts B after timeout. Late-success and untimed
fallback controls pass on that base.
Blacksmith Testbox,
including persisted rotation, scoped outcomes, static fallback, and refresh-queue
lifecycle. The tests join the actual preparation before checking late work.
ensureOpenClawModelsJsonwith the real Chutesplugin and refresh owner, synthetic persisted accounts, and controlled HTTP
grant/catalog responses. It verifies the following results and removes its
isolated state and servers afterward:
graphs were reused from the preceding tested head after verifying that the only
intervening change is the root test's fixture-presence assertion; final root-test
types and remaining gates were rerun successfully.
is green. Independent full-patch and fixture-correction reviews are clean
through P2. No production findings remain.