Repository navigation
fix(test): avoid unhandled catalog startup rejection - #158440
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 25, 2026, 7:55 PM ET / 23:55 UTC. ClawSweeper reviewWhat this changesThe branch changes the Gateway catalog startup test to release a pause successfully and throw its existing fixture error from the awaited bootstrap mock. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still has the rejection-prone test fixture, and the PR fixes its promise handling without changing Gateway runtime behavior. No introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherGateway startup captures a model catalog snapshot before asynchronous bootstrap work. This test pauses bootstrap to check that the captured provider and pricing data stays stable, then checks how startup fails. flowchart LR
A[Stored model catalog] --> B[Gateway startup snapshot]
B --> C[Paused bootstrap]
C --> D[Provider and price checks]
D --> E[Startup error settles]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +1. Total +1 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain a deterministic startup-boundary test that checks catalog snapshot timing, exact failure identity, clean promise settlement, and its measured test cost. Do we have a high-confidence way to reproduce the issue? Yes, as a source-level path: current main can reject the gate before asynchronous startup reaches the mocked bootstrap call, and the PR reports a cold Vitest failure. I did not execute the test in this read-only review. Is this the best way to solve the issue? Yes. Throwing from the awaited mock preserves the original startup assertions and exact error check while removing the early rejected promise. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b74bd07a2fb0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…openclaw#157940) * fix(subagents): retain pending collector cleanup until Stop publishes * fix(agents): settle accepted collector rollback after publication * test(agents): keep collector fixtures within line caps * fix(test): avoid unhandled catalog startup rejection (openclaw#158440)
What Problem This Solves
Fixes an unhandled rejection in the cold Gateway catalog startup test, which could fail validation even when all three test cases passed.
User Impact
No runtime behavior changes. The fixture still verifies synchronous metadata capture and startup with provider settings without model rows.
Why This Change Was Made
The fixture rejected a deferred promise before startup had attached to it through an asynchronous module import. Resolve a void gate instead, then throw the same sentinel from the awaited bootstrap mock. Keep the metadata assertions before any await and preserve cleanup and exact error-identity checks.
Evidence
fixture stops bootstraprejection and exited 1.44f11c565956954260042108a5e6f77a4c8ab837: the same single-file command passed all three cases, exited 0, and had no unhandled rejection or late-handler warning. Node 24.21.0 / pnpm 12.4.2, one worker; source pins matched before and after. The delegated worker joined and stopped.gateway-servertest-type graph passed.The cold candidate run addresses the review's cold-first proof and timing request without changing the head. Both cold commands were
pnpm test src/gateway/server.catalog-startup.test.tswithCI=1 OPENCLAW_VITEST_MAX_WORKERS=1.The candidate command measured 67.081 s end to end. Its native delegated run reported 238.919 s total including setup; execution record. The external lease owner stops the worker after completion, so the backing workflow can show cancellation; the joined native result was exit 0. These single observations establish test cost and the repaired failure mode, not a speedup or tail-latency claim.