Skip to content

test(hooks): await duplicate-module relay publication - #145771

Merged
steipete merged 1 commit into
mainfrom
steipete/ci-native-hook-relay-stale
Sep 12, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/ci-native-hook-relay-stale

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

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 with native 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

  • Source CI failure: https://github.com/openclaw/openclaw/actions/runs/34679294250/job/103514926194
  • The unmodified relay file passed all 124 tests in isolation. The unmodified 148-file CI group also passed locally, confirming the failure depends on scheduling.
  • A temporary 300 ms worker scheduling pause reproduced the exact rejection in isolation and in the captured CI dispatch order, using real SQLite, real HTTP, three non-isolated workers, and the unchanged 2-second request timeout. Before the fix, the ordered group reported 1 failed / 146 passed / 1 skipped file; the only failure was this test.
  • The same controlled pause passes after awaiting publication. The diagnostic pause is not part of this patch.

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.mjs and git diff --check passed. 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 add5bcb0fc2ac95b44a97112677f3ac873b5ecc3 found no actionable findings. No fixups or skips are required; the patch is unchanged.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Sep 12, 2026
@steipete
steipete marked this pull request as ready for review September 12, 2026 07:35
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 3:54 AM ET / 07:54 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: add5bcb0fc2ac95b44a97112677f3ac873b5ecc3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported test repair with preserved assertions and no identified correctness blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair; the supplied controlled SQLite/HTTP replay and verified successful head CI support the changed publication ordering.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair; the supplied controlled SQLite/HTTP replay and verified successful head CI support the changed publication ordering.
Evidence reviewed 8 items Verified introduced change: The pinned introduction changes only the two registration calls and adds their readiness waits. Existing approval, stale-handle teardown, HTTP response assertions, and the 2-second request timeout remain intact.
Existing readiness contract: Both registration APIs call the same internal owner. The owned handle exposes readiness combining bridge publication and policy preparation; bridge readiness resolves after writing the SQLite locator. This repair depends on OpenClaw’s publication lifecycle, not an external Codex runtime or protocol change.
Publication race and retained coverage: The real HTTP client retries stale registrations only within 250 ms, supporting the reported scheduling failure. Adjacent tests separately retain delayed-publication and stale-generation rejection coverage.
Findings None None.
Security None None.

How this fits together

OpenClaw’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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 2 +2

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This bounded test reliability repair addresses a documented scheduling failure affecting unrelated PR validation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair; the supplied controlled SQLite/HTTP replay and verified successful head CI support the changed publication ordering.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-12T07:41:16.420Z sha add5bcb :: needs maintainer review before merge. :: none

@steipete
steipete merged commit e6a3bdf into main Sep 12, 2026
187 checks passed
@steipete
steipete deleted the steipete/ci-native-hook-relay-stale branch September 12, 2026 08:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant