Repository navigation
test(gateway): preserve held-work close failures - #139593
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 5, 2026, 9:26 PM ET / September 6, 2026, 01:26 UTC. ClawSweeper reviewWhat this changesThe Gateway shutdown test helper preserves close errors and rejects premature close completion while work remains held. Merge readiness✅ Ready for maintainer review Keep open: current main still has the observer gap, and the focused patch addresses it without an identified correctness defect. The maintainer-authored PR is also protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherGateway lifetime tests hold asynchronous work while shutting down a real test server. This shared helper checks that connections have released and shutdown remains pending until the held work finishes. flowchart TD
A[Gateway lifetime tests] --> B[Hold asynchronous work]
B --> C[Start Gateway shutdown]
C --> D[Observe owner drain and connection release]
D --> E[Check public close outcome]
E --> F[Preserve rejection or reject early completion]
E --> G[Confirm shutdown remains pending]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +1. Total +1 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the shared observer strict about public shutdown completion while preserving the original rejection and existing cleanup ownership. Do we have a high-confidence way to reproduce the issue? Yes, from source: supply an already-rejected close promise or an early successful close while the observed drain remains pending. The current-main helper can mask the rejection or miss premature completion; no tests were executed during this read-only review. Is this the best way to solve the issue? Yes. Racing the original promise and checking its settlement state repairs the shared observation boundary without replacing native drain behavior or increasing timeouts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against abd18df28d85. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (302 commits) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) test(qa): make cleanup child logging deterministic (#139566) test(cli): keep Unix socket fixtures within path limits (#139565) fix: avoid slow incognito key checks in large session stores (#139528) feat(macos): open Gateway windows from the Gateways menu (#139522) test(workshop): isolate marker casing fixture identities (#139554) fix(process): require cleanup evidence before releasing owned work (#139517) ... # Conflicts: # scripts/release-check.ts
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) ...
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) ...
Related: #139576
What Problem This Solves
Resolves a problem where the Gateway lifetime test observer could report work as held after public close had already completed, or replace a native close rejection with an assertion error.
Why This Change Was Made
Race the original closing promise at the final observation boundary and require public close to remain pending. Keep the existing bounded entry wait, native drain observation, connection-release checks, and cleanup ownership unchanged.
User Impact
No production behavior changes. Developers get an accurate failure at the held-work boundary and retain the original close error. The change is one net test-support line; no baseline or timeout changes.
Evidence
Six temporary controls exercise the real AsyncWorkScope and Vitest spy contract. On current main, early public close and rejection identity fail (two failures, four passes); the candidate passes all six. Scoped type-aware lint and independent P0–P2 review pass. The controls are retained proof, with no new maintained test file or production seam.
All four existing Gateway lifetime callers and their work-scope owner are byte-identical to the previously passed 15-case real-Gateway batches. Exact-head CI remains required before landing. No user-facing UI, provider API, storage, or runtime change is made.