Repository navigation
improve: reduce idle waits in account catalog login tests - #147228
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 13, 2026, 2:22 PM ET / 18:22 UTC (Revision 2). ClawSweeper reviewWhat this changesReplace fixed waits in account-model login integration tests with catalog-publication polling and an explicitly held HTTP refresh response. Merge readiness✅ Ready for maintainer review This remains a useful, focused test improvement: current main retains the idle waits, and no introduced correctness defect was found. The prior review recorded no findings; maintainer-authored work also remains protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway publishes account-specific model choices after provider login and serves them through model-list requests. These integration tests exercise that flow with a local HTTP provider, checking timely publication, passive reads, and selected-account behavior during refresh. flowchart LR
A[Fixture account login] --> B[Gateway login flow]
B --> C[Account catalog discovery]
C --> D[Local HTTP provider]
D --> E[Published model choices]
E --> F[Passive model reads]
F --> G[Publication and latency assertions]
D --> H[Held refresh response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +30. Total +30 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the existing integration boundary and assertions while synchronizing on publication and the actual outstanding HTTP response. Do we have a high-confidence way to reproduce the issue? Not applicable to a product defect: fixed idle waits are directly visible on current main, and the PR reports before/after test runs; this review did not execute tests. Is this the best way to solve the issue? Yes. Synchronizing the existing test with observable publication and an outstanding HTTP response preserves its purpose without adding production hooks or increasing deadlines. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 21de1eaf75db. 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)
|
a701802 to
5af1503
Compare
|
Merged via squash.
|
* commit '28887b564210326174413d0d8ade72b38268d5f3': (1827 commits) fix(qa): bind coverage IDs to producer assertions (#144000) fix(linux): explain FreeBSD desktop setup prerequisites (#147211) fix(memory): split embedding batches rejected for an input array item cap (#139541) test: isolate timing metadata persistence from inherited settings (#147112) refactor(status): retire test-only helper publication (#147071) improve: reduce workspace agent lookup work for large fleets (#147144) refactor(macos): share connect credential selection (#144214) fix(plugins): restore Slack onboarding after core updates (#147109) refactor: share ANSI compatibility matching (#146998) fix(test): settle Models catalog before picker open (#147215) test(ui): reuse panel tab drag fixture (#147250) fix(install): use system Node for FreeBSD CLI setup (#147204) fix(cli): explain MCP probes with no enabled servers (#147216) docs: require UI screenshots in chat and PR (#147263) docs(skills): clarify remote gog OAuth setup for Gateway hosts (#145945) test: replace idle account catalog waits with synchronization (#147228) feat(qa): preserve maturity decision context (#147219) feat(macos): clarify agent activity in native chat (#147197) fix(runtime): complete Bun compatibility follow-ups (#147085) fix(ui): release closed chat panes after queued updates (#147240) ...
## 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]>
What Problem This Solves
Account catalog login tests keep waiting after discovery has completed and use a fixed delay to hold a refresh request open.
User Impact
No user-visible behavior changes. The two integration scenarios run with less idle waiting while retaining their discovery and refresh checks.
Why This Change Was Made
Wait for catalog publication within the original ten-second observation deadline, then perform the original paired passive reads. Keep the real seven-second discovery delay, early reads, latency and pending-provider assertions, and checks that passive reads do not initiate provider requests.
For the later manual refresh, hold the actual HTTP response until the selected-account assertions finish, then release and await settlement in
finally. A successful cached RPC return remains valid while background HTTP work continues. The test grows by 30 lines to make this synchronization explicit.Evidence
Both original cases pass with unchanged names and order. A separate warm original run measured 14.978s and 15.688s, versus 6.238s and 8.354s for the candidate. These are single observations with uncontrolled cache warmth and host load, not a causal whole-suite speedup measurement.
Disabling the actual post-login catalog producer makes both retained final publication oracles fail. Forcing an assertion failure while the HTTP response is held confirms refresh settlement, Gateway closure, and endpoint/state cleanup. The initial JSON-only reporter hid cleanup markers; rerunning the same control with visible reporting captured all three stages.
Independent review found no actionable issues. The mapped check passes, including formatting, the core test typecheck, guards and lint. Its initial two type-style findings were corrected without changing runtime behavior.
Local validation ran on the original pinned base. The branch was refreshed onto current main with the exact test patch and relevant owners unchanged after CI found an unrelated Workboard lint failure; new CI validates the refreshed base.