Repository navigation
test(hooks): await duplicate-module relay publication - #145771
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 12, 2026, 3:54 AM ET / 07:54 UTC (Revision 2). ClawSweeper reviewWhat this changesThe duplicate-module relay test waits for initial and replacement HTTP endpoint publication before exercising shared relay state. Merge readiness✅ Ready for maintainer review The repair remains necessary on inspected main and preserves the test’s meaningful assertions. No actionable defect was found; the maintainer-authored PR is ready for ordinary merge handling. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s native hook relay connects native agent hook events to shared hook and approval handling. Its HTTP client discovers the active endpoint through SQLite, so transport tests need publication to finish before invoking that endpoint. flowchart LR
A[Duplicate module test] --> B[Register relay owner]
B --> C[Start local HTTP endpoint]
C --> D[Publish SQLite locator]
D --> E[Readiness resolves]
E --> F[Invoke replacement relay]
F --> G[Check shared state and response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing publication promise to establish this test’s transport precondition while retaining separate race and stale-owner coverage. Do we have a high-confidence way to reproduce the issue? Yes, the source establishes an asynchronous publication race with a bounded stale-response retry window, and the PR reports a controlled before/after reproduction. This review did not execute that reproduction. Is this the best way to solve the issue? Yes. Awaiting the existing owner promise establishes the HTTP test’s precondition without weakening assertions, extending timeouts, or changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8c2996e01303. 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.
|
Refs openclaw#145349 The duplicate-module native hook relay test could invoke a replacement before its HTTP endpoint and SQLite locator finished publication. On a delayed worker, the stale-registration response could then arrive after the existing retry grace and fail unrelated CI. Use the existing owned-registration API and await readiness for both registrations. Preserve shared approval state, stale-handle teardown, and exact HTTP-response assertions. This is a test synchronization repair with no production behavior or timeout change. Source failure: CI run 34679294250, job 103514926194. https://github.com/openclaw/openclaw/actions/runs/34679294250/job/103514926194 Proof: the PR records controlled failing-before/passing-after reproduction, 138 focused passing tests, and an uninstrumented ordered replay passing 147 files / 3,288 tests. The native watcher reverified GREEN on exact head add5bcb in CI run 34681115215. https://github.com/openclaw/openclaw/actions/runs/34681115215 ClawSweeper review: no actionable findings on the exact head; no fixups or skips required. The lead's independent review was scoped-clean at P0/P1.
Refs #145349
Additional instructions
The branch is in openclaw/openclaw and repository maintainers can push to it.
What Problem This Solves
Resolves a problem where unrelated PRs fail the native-hook-relay duplicate-module test in
checks-node-compact-large-15. CI run 34679294250, job 103514926194, rejected its successor bridge invocation withnative hook relay bridge stale registration.Why This Change Was Made
The fixture invoked the bridge immediately after replacement. Registration switches the shared in-memory owner synchronously, but retires the old SQLite locator and publishes its successor asynchronously. The immediate read can capture the old locator; a delayed HTTP response then arrives after the existing 250 ms stale-locator retry grace.
Await the existing owned-registration publication promise for the initial relay and its replacement. This preserves the duplicate-module, shared-approval, stale-handle teardown, and exact HTTP-response assertions while establishing their actual transport precondition. Production already awaits relay preparation before launching native hooks.
User Impact
Developers no longer encounter this scheduling-dependent CI failure. There is no production behavior, configuration, storage, or timeout change.
Evidence
Validation uses Node 24.20.0 on macOS. Original CI ran Linux x64; one Linux-only test file is skipped locally. The original log does not identify worker assignment, which remains timing-dependent; replay preserves its 148-file membership, original file-size dispatch order, and three-worker non-isolated configuration.
Final-patch focused proof:
node scripts/run-vitest.mjs src/agents/harness/native-hook-relay.test.ts src/agents/harness/native-hook-relay.lifecycle.test.ts— 138 passed. The final uninstrumented ordered replay passed 147 files / 3,288 tests (one file / 13 tests skipped on macOS).node scripts/check-changed.mjsandgit diff --checkpassed. Independent Codex review is clean at P0/P1 in both local and committed-branch modes. This is a maintainer-requested repair of the CI failure linked above.Exact-head CI passed; the repository watcher finished GREEN: https://github.com/openclaw/openclaw/actions/runs/34681115215 (head
add5bcb0fc2ac95b44a97112677f3ac873b5ecc3).ClawSweeper review
The completed review of
add5bcb0fc2ac95b44a97112677f3ac873b5ecc3found no actionable findings. No fixups or skips are required; the patch is unchanged.