Repository navigation
fix(test): join Gateway completion before teardown - #160387
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 changes before merge. Reviewed September 28, 2026, 7:22 AM ET / 11:22 UTC. ClawSweeper reviewWhat this changesThe branch changes a Gateway end-to-end test to register a subagent run before seeding its delivery row, then wait for detached completion work before checking suspension. Merge readiness⛔ Needs changes before merge - 1 item remains Current main still uses a timed assertion in this Gateway fixture, and the submitted repair addresses the fixture’s detached cleanup path. The branch remains useful; its changed test has not yet produced a focused result. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway fixture creates a completed subagent run and resumes its pending delivery. The registry and delivery store settle that work before the test checks the resulting state. flowchart LR
A[Gateway test fixture] --> B[Register subagent run]
B --> C[Seed delivery row]
C --> D[Resume completion]
D --> E[Join detached work]
E --> F[Assert suspended delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +6. Total +6 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the fixture tied to canonical delivery state and join its owned cleanup; confirm the suspended result in a focused cold Gateway run and record the test cost. Do we have a high-confidence way to reproduce the issue? No deterministic current-main replay is established. The linked CI failure and independent branch report show the pending-state assertion failure, while current main still uses the timed fixture path. Is this the best way to solve the issue? Yes, the change uses the existing observer for the detached cleanup owner and preserves the suspended-state assertion. A focused run is still needed to confirm the result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 162dea17b031. 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
|
Join detached native completion work before asserting suspended delivery and closing the Gateway. Seed the canonical registered record first and retain the cold worker path and original assertions. Validation: focused Gateway E2E 1/1 passed; format, Gateway test types and typed lint passed under bounded process-tree budgets; exact-head CI green. Independent autoreview and ClawSweeper found no actionable code findings; the requested E2E result and wall time are recorded in the PR. Related: openclaw#160010
Related: #160010
Validation prerequisite for #160311.
What Problem This Solves
The Gateway completion E2E fixture can assert before detached native suspension finishes, failing unrelated lint-memory fixes with a still-pending delivery.
User Impact
No runtime behavior changes. The test retains its real cold-worker path and original suspended-state assertion while waiting for the work it started before Gateway teardown.
Why This Change Was Made
The fixture owns setup and settlement. Registering the run before seeding persists its canonical physical store bindings. The existing root-work observer joins detached cleanup and its asynchronous scope tails; the one-second polling loop is removed. No timeout increase, worker warming, mock broadening, or production change.
Evidence
116d96e16434e1e346ff7c1e1faa78ad1a5606b8. The fixture and inspected runtime owners are byte-identical to basee0e21ec70cfed25353c06711c1d5151ef5ce936c. The same failure was recorded on independent branches in refactor(gateway): schedule remote skill refresh #160318.suspended / permanent_failure / expiry. Vitest wall time was 54.62s; the complete managed command was 731.777s, including the required private QA rebuild (656.8s) and worker preparation. The build started without a usable build stamp on a retained worker from the interrupted setup; this is not a clean-machine performance benchmark.60df088d2d1f792a35f5a23ed7f344e6ee0d53c446a4e0097971864ec22d1639before and after execution. The tested file matches this head (SHA2569a5820b4b69972cb22c1c28728b48dd55b7a9bc549cb717c1ba3557eeea0a088before and after). Five declared generated plugin bundles are excluded from the source fingerprint; authored inputs remain checked.This small test-only prerequisite is required to validate the new lint graph repair; it does not claim to fix a production completion defect or to independently prove seed order caused the observed CI failure.