Repository navigation
test(gateway): join placement fence recovery before teardown - #160124
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 28, 2026, 1:07 AM ET / 05:07 UTC. ClawSweeper reviewWhat this changesThe branch replaces a timed poll in a Gateway worker-placement test with an admission-close signal and ensures two recovery tests finish their held operations before teardown. Merge readiness✅ Ready for maintainer review Keep open. Current main still has the timeout-prone test, and the related duplicate was closed unmerged in favor of this PR. Source review found no introduced defect. Priority: P3 Review scores
Verification
How this fits togetherGateway worker-placement recovery compares stored session placements with their worker environments. These tests hold a nested session tool operation while recovery fences new calls, waits for the held operation, and reaches a final placement state. flowchart LR
A[Stored placement] --> B[Gateway reconciliation]
C[Running session tool] --> D[Admission fence]
B --> D
D --> E[Wait for tool completion]
E --> F[Worker teardown]
F --> G[Final placement state]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +32. Total +32 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep both recovery fixtures synchronized with the real admission fence and ensure held tool work settles before shared-state teardown. Do we have a high-confidence way to reproduce the issue? No deterministic slow-runner replay was run in this read-only review. Current main contains the timed poll, and the PR reports a CI failure at that boundary. Is this the best way to solve the issue? Yes. The test observes the real synchronous admission close, preserves the lifecycle assertions, and joins reconciliation before database teardown. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 02e1ac8391f8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Additional exact-head Linux proof for
This supplements the author's 65/65 full-file Testbox proof and independent P0–P2 review. The production fence is exercised, and no timeout, retry or assertion was weakened. Landing as a pure inherited-CI repair under the maintainer's exact-head immediate squash direction; the package refactor remains separate and unmerged. |
Refresh the PR merge ref after #160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged.
Refresh the PR merge ref after #160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged.
Refresh the PR merge ref after #160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged.
Refresh the PR merge ref after #160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged.
Refresh the PR merge ref after #160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged.
* refactor(packages): deslop shared packages second pass Consolidate remaining stream, parser, schema projection and normalization paths while preserving public exports, wire shapes and runtime semantics. Retain the prior package cleanup owners and shrink assertion ratchets for removed casts. * refactor(packages): preserve schema declarations and finish type cleanup * refactor(packages): preserve explicit guards and import ordering * refactor(packages): retain distinct plugin result declarations * fix(sdk): bundle private session URL dependency The private session URL contract exports TypeScript source and has no standalone package build. Keep it as a build-time dependency so the existing package builder bundles it into the SDK. The unchanged external-consumer E2E reproduced the missing build-script failure before this repair. * ci: refresh packages proof after inherited fixture repairs Refresh the PR merge ref after #160024 repaired the trusted harness inventory and ordinary child-process jsdom preload. Package source and the reviewed tree are unchanged. * ci: refresh packages proof after placement fixture repair Refresh the PR merge ref after #160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged. * ci: refresh packages after compiler scheduling repair Refresh the PR merge ref after #160290 separated per-group scheduling from shared compiler inputs. The package tree and active Testbox source hashes are unchanged. * ci: refresh packages after lazy import guard repair
* refactor(packages): deslop shared packages second pass Consolidate remaining stream, parser, schema projection and normalization paths while preserving public exports, wire shapes and runtime semantics. Retain the prior package cleanup owners and shrink assertion ratchets for removed casts. * refactor(packages): preserve schema declarations and finish type cleanup * refactor(packages): preserve explicit guards and import ordering * refactor(packages): retain distinct plugin result declarations * fix(sdk): bundle private session URL dependency The private session URL contract exports TypeScript source and has no standalone package build. Keep it as a build-time dependency so the existing package builder bundles it into the SDK. The unchanged external-consumer E2E reproduced the missing build-script failure before this repair. * ci: refresh packages proof after inherited fixture repairs Refresh the PR merge ref after openclaw#160024 repaired the trusted harness inventory and ordinary child-process jsdom preload. Package source and the reviewed tree are unchanged. * ci: refresh packages proof after placement fixture repair Refresh the PR merge ref after openclaw#160124 repaired the inherited placement fence synchronization and cleanup race. The reviewed and Testbox-proven package tree remains unchanged. * ci: refresh packages after compiler scheduling repair Refresh the PR merge ref after openclaw#160290 separated per-group scheduling from shared compiler inputs. The package tree and active Testbox source hashes are unchanged. * ci: refresh packages after lazy import guard repair
What Problem This Solves
Placement reconciliation now awaits state-worker recovery reads before fencing a turn. The runtime-owner test polled for that boundary with Vitest's one-second default. On a slow runner it failed before completing the held tool operation or joining reconciliation, then database teardown produced an unhandled admission-closed error.
Observed in https://github.com/openclaw/openclaw/actions/runs/36377034783/job/108789323672 (attempt 2).
User Impact
Test-only repair. Observe the real admission-close boundary, preserving the authorization, draining-claim, teardown-order, and final-state assertions. Always complete the held operation and join reconciliation before database teardown, including assertion failures. Apply the same cleanup contract to the sibling staged-result fixture.
Evidence
Exact head
257347684d8daa4c3c464b792c4d7b984484aafbpassed all 65 tests in the two affected files on Testbox, with one worker: 68.13s Vitest wall, 69.46s through the repository wrapper, 1m12.522s complete proof. Targeted formatting and whitespace pass. Independent P0–P2 review is clean; the owner closes admission synchronously before awaiting running operations. CI remains required.Production +0/-0; tests +69/-37. No timeout increase, mock fence, production behavior change, or changelog entry.