Repository navigation
test(agents): drain relay renewal cleanup after setup failures - #149885
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 16, 2026, 4:49 AM ET / 08:49 UTC (Revision 2). ClawSweeper reviewWhat this changesThe relay lifecycle test now releases its renewal barrier and drains registered cleanup work without waiting for a renewal that might never start. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main retains the cleanup wait that can hang after setup failure. No actionable patch defects remain, and the maintainer-authored PR is protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherNative-hook relays connect agent hook requests to OpenClaw and maintain a local listener plus a stored locator. This test checks renewal ordering and must finish relay cleanup before releasing its isolated test state. flowchart TD
A[Test setup] --> B[Publish relay locator]
B --> C[Hold renewal at barrier]
B --> D[Setup failure]
C --> E[Release barrier and unregister]
D --> E
E --> F[Drain renewal and listener cleanup]
F --> G[Release isolated test state]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -6. Total -6 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep teardown under the existing relay cleanup owner while preserving the renewal barrier and durable-expiry assertion. Do we have a high-confidence way to reproduce the issue? Yes, from source: a locator-polling failure occurs before renewal starts, leaving the old finally block awaiting a deferred that cannot resolve. This review did not execute that failure path. Is this the best way to solve the issue? Yes. Reusing the existing drain removes the impossible wait without weakening assertions, extending deadlines, or adding another cleanup mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc8c9d43acba. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
(cherry picked from commit 6fcfa94)
What Problem This Solves
The native-hook renewal-expiry fixture can hide an initial locator polling failure. Its cleanup waits for a renewal-only deferred even when setup failed before renewal started, leaving the fixture pending until the outer test timeout.
User Impact
Test failures retain their original error and release fixture resources. Production relay behavior is unchanged.
Why This Change Was Made
Cleanup now releases the renewal barrier, unregisters the relay, and uses the existing
clearNativeHookRelaysForTestsowner to join admitted work. The bridge retains renewal work before the test observes its entry; unregister chains owned deletion and listener closure after that work. This removes the extra promise whose operation might never start, matching the preceding renewal-close fixture.The expiry assertion, renewal entry/release barrier, locator polling, and deadlines remain unchanged.
Evidence
A controlled JavaScript proof executes the actual fixture and bridge drain owner with the registration facade, storage, HTTP, test-state, and test-runner effects mocked. The original fixture stays pending when publication lookup fails before renewal. The repaired fixture preserves the exact original error and completes cleanup. Both original and repaired successful-renewal controls pass, and the repaired drain joins renewal settlement before deletion and listener closure.
Scoped changed-file gates passed, including the affected agent test type graph, formatting, guards, all export scans, and targeted lint. Independent P0–P2 review found no actionable issues.
Hosted CI run 35073372705 passed for head
1063dc73757bdbabf52ee3697090ce5282e86923. Its changed-node job passed all 21 relay lifecycle cases, including the repaired expiry case in 880 ms, on tested merge6beb0a7b05f02d2692dac5e6d4ee9b9b580e8b07.No native SQLite or held-native scenario was run locally. This demonstrates the fixture cleanup defect; it does not establish that this path caused the timeout observed in CI run 35068857293.