Skip to content

improve: reduce idle waits in account catalog login tests - #147228

Merged
steipete merged 1 commit into
mainfrom
codex/test-auth-login-catalog-waits
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-auth-login-catalog-waits

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 13, 2026 17:31
@steipete
steipete requested a review from a team as a code owner September 13, 2026 17:31
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 2:22 PM ET / 18:22 UTC (Revision 2).

ClawSweeper review

What this changes

Replace 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
Reviewed head: 5af15037ad9b334c00029adfcd854cc276f4d132

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test improvement with retained behavioral checks, explicit response cleanup, and useful reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test-only PR; its body reports registered Gateway login/list runs against a local HTTP provider and targeted failure controls.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test-only PR; its body reports registered Gateway login/list runs against a local HTTP provider and targeted failure controls.
Evidence reviewed 7 items Introduced scope and synchronization: The complete introduced patch changes only the login catalog integration test. Both delay cases, the early observation, paired passive reads, latency assertions, and final publication assertions remain. The refresh response is released in finally.
Current-main necessity: Fetched main still observes fixed offsets of one and ten seconds and uses a seven-second delay for the later refresh. The submitted synchronization improvement is therefore still distinct.
Production read and refresh boundary: The Gateway list owner initiates deferred discovery for explicit refresh and otherwise reads the prepared catalog. The changed test uses a synthetic provider with native fetch against loopback HTTP; it does not claim compatibility with a Codex dependency contract.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +30. Total +30 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 48 18 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 48 18 +30

Review metrics

Metric Value Why it matters
Production versus test growth Production +0; tests net +30 lines The added synchronization stays entirely in the existing test and introduces no production seam.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This reduces idle integration-test waiting without changing product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test-only PR; its body reports registered Gateway login/list runs against a local HTTP provider and targeted failure controls.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 3d7d211 adds src/gateway/server-methods/models-auth-login.catalog.integration.test.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d7d21166f09; files: src/gateway/server-methods/models-auth-login.catalog.integration.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-13T17:39:17.863Z sha a701802 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/test-auth-login-catalog-waits branch from a701802 to 5af1503 Compare September 13, 2026 18:08
@steipete
steipete merged commit f9de036 into main Sep 13, 2026
99 of 101 checks passed
@steipete
steipete deleted the codex/test-auth-login-catalog-waits branch September 13, 2026 18:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* 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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
obviyus added a commit that referenced this pull request Sep 14, 2026
## 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant