Repository navigation
fix(models): discover account models after sign-in - #145190
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: blocked before merge. Reviewed September 12, 2026, 2:28 AM ET / 06:28 UTC (Revision 23). ClawSweeper reviewWhat this changesRefresh account model choices after sign-in and credential changes, keep existing choices usable during discovery, and publish progress and completed results to model menus and web pickers. Merge readiness⛔ Blocked before merge - 6 items remain This remains useful, distinct work beyond the merged picker fixes. The documented SDK compatibility contract addresses the prior warning, and no blocking correctness finding was identified. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway prepares model choices from provider plugins, native runtimes, configuration, and account credentials. Its published catalog feeds chat commands, web pickers, and native clients. flowchart TD
A[Sign-in or credential change] --> B[Publish starter choices]
B --> C[Provider-scoped discovery]
D[Provider and native catalogs] --> C
C --> E{Generation still current?}
E -->|Yes| F[Publish account choices and status]
E -->|No| G[Discard retired results]
F --> H[Chat menus and client pickers]
Decision needed
Why: Repository policy requires listed-owner involvement on this restricted path; functional proof and a clean code review cannot supply that approval. Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep discovery with the prepared catalog owner, preserve passive browsing and account-generation fencing, and retain the documented SDK host requirement through owner-approved landing. Do we have a high-confidence way to reproduce the issue? Yes: registered sign-in followed by passive model-list reads is a concrete reproduction path supported by current-main publication code and historical failing traces; current main was not executed during this review. Is this the best way to solve the issue? Yes: extending the existing catalog lifecycle avoids picker-triggered discovery and preserves one publication owner; the SDK compatibility warning now has an explicit contract and focused coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 27e810cf2625. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (22 earlier review cycles; latest 8 shown)
|
## What Problem This Solves Login catalog tests can fail while automatic discovery is working correctly. ## Why This Change Was Made Wait for the automatic HTTP request, hold its response through early reads, then confirm the published account row through passive `models.list`. This state has one writer: the fixture. This extends #147228 and preserves coverage for #145190. The fixed final-observation deadline is removed; the seven-second endpoint delay, read-latency limit, and 120-second test timeout remain. ## User Impact No production behavior changes. ## Evidence Failures: [34761804381](https://github.com/openclaw/openclaw/actions/runs/34761804381), [34799773048](https://github.com/openclaw/openclaw/actions/runs/34799773048), [34817608735](https://github.com/openclaw/openclaw/actions/runs/34817608735). `node scripts/run-vitest.mjs src/gateway/server-methods/models-auth-login.catalog.integration.test.ts`: reversing the automatic discovery calls from #145190 fails both cases; twenty corrected runs pass. Local lint, types, protocol and guards pass. Both hosted cases [pass](https://github.com/openclaw/openclaw/actions/runs/34824551516/job/103914012589) on merge `e847ce8327cf`, combining main `43d413bd3938` with head `f100a3fc2efb`. Both credential-refresh tests pass with this patch on main `7066d660a6fd`; they already observe request receipt or acknowledged publication. ## Compatibility No public contract changes. ## Consumers Only the login catalog test changes. The separate client-stop timeout remains outside this repair: no evidence links its socket-close failure to this observation race. ## Invalidation Request receipt and catalog publication drive observations; cleanup removes listeners. ## Tests Both endpoint delays and all passive-read and manual-refresh checks remain. Both held early responses must report pending; exactly one automatic request is required. Co-authored-by: Ayaan Zaidi <[email protected]>
## What Problem This Solves Login catalog tests can fail while automatic discovery is working correctly. ## Why This Change Was Made Wait for the automatic HTTP request, hold its response through early reads, then confirm the published account row through passive `models.list`. This state has one writer: the fixture. This extends openclaw#147228 and preserves coverage for openclaw#145190. The fixed final-observation deadline is removed; the seven-second endpoint delay, read-latency limit, and 120-second test timeout remain. ## User Impact No production behavior changes. ## Evidence Failures: [34761804381](https://github.com/openclaw/openclaw/actions/runs/34761804381), [34799773048](https://github.com/openclaw/openclaw/actions/runs/34799773048), [34817608735](https://github.com/openclaw/openclaw/actions/runs/34817608735). `node scripts/run-vitest.mjs src/gateway/server-methods/models-auth-login.catalog.integration.test.ts`: reversing the automatic discovery calls from openclaw#145190 fails both cases; twenty corrected runs pass. Local lint, types, protocol and guards pass. Both hosted cases [pass](https://github.com/openclaw/openclaw/actions/runs/34824551516/job/103914012589) on merge `e847ce8327cf`, combining main `37c97a239f5f` with head `f100a3fc2efb`. Both credential-refresh tests pass with this patch on main `1077e0c609e6`; they already observe request receipt or acknowledged publication. ## Compatibility No public contract changes. ## Consumers Only the login catalog test changes. The separate client-stop timeout remains outside this repair: no evidence links its socket-close failure to this observation race. ## Invalidation Request receipt and catalog publication drive observations; cleanup removes listeners. ## Tests Both endpoint delays and all passive-read and manual-refresh checks remain. Both held early responses must report pending; exactly one automatic request is required. Co-authored-by: Ayaan Zaidi <[email protected]>
* ci: advance trusted Kova pin to 2026.9.7 release budgets Kova openclaw/Kova#157 (95a25b6b) raises five release-profile budgets that current main exceeds by design, approved by Peter for 2026.9.7: gateway-performance gateway-tree RSS and gateway CPU, bundled-plugin-startup gateway CPU, fresh-install gateway CPU, and the embedded agent CLI RSS cap. Causes: #145190 startup provider-catalog acquisition and #152840 SQLite state-worker growth; follow-up #160501. * ci: include the gateway-tree CPU budget in the trusted Kova pin Advance to openclaw/Kova#158 (5f2e98a5): gateway-performance gateway-tree maxCpuPercent 300 -> 325, which the strict release gate reported as BLOCKED at 272-300.3 % on main (run 36455844495).
…w#160573) * ci: advance trusted Kova pin to 2026.9.7 release budgets Kova openclaw/Kova#157 (95a25b6b) raises five release-profile budgets that current main exceeds by design, approved by Peter for 2026.9.7: gateway-performance gateway-tree RSS and gateway CPU, bundled-plugin-startup gateway CPU, fresh-install gateway CPU, and the embedded agent CLI RSS cap. Causes: openclaw#145190 startup provider-catalog acquisition and openclaw#152840 SQLite state-worker growth; follow-up openclaw#160501. * ci: include the gateway-tree CPU budget in the trusted Kova pin Advance to openclaw/Kova#158 (5f2e98a5): gateway-performance gateway-tree maxCpuPercent 300 -> 325, which the strict release gate reported as BLOCKED at 272-300.3 % on main (run 36455844495).
Repairs #144329 by @obviyus. Related: #144768, #145051, #145430, #145391, #145428, #145478, #145384, #145525.
What Problem This Solves
Successful sign-in could leave account models absent until manual refresh. Slow discovery could also delay credential publication or lose results after the caller stopped waiting.
Why This Change Was Made
The prepared catalog owner publishes static choices, then account rows for the changed provider. Discovery releases the build queue and continues after the caller's wait ends. Renewal retains compatible rows; logout rejects late results. Browser publication preserves newer Retry results.
User Impact
Pickers open without discovery requests and update while open. Ordinary /models reads stay passive. Explicit Refresh or Retry discovers later releases. Plugins using the optional provider selector need a supporting host release.
Consumers: login and credential renewal publish account models; chat menus and web pickers show pending and completed catalog state; plugin catalog augmentation can select provider hooks.
Evidence
Browser login → picker and Telegram login → /models passed with a seven-second recording endpoint: static choices remained available and late account rows appeared. Explicit refresh discovered an added row. Registered login, renewal, logout, catalog, and browser tests cover failure, empty results, and stale publication. Continuous integration passed. Physical native clients and live provider entitlement were not tested.