Skip to content

test(infra): consolidate abort relay coverage at its owner - #134266

Merged
steipete merged 1 commit into
mainfrom
codex/test-abort-relay-owner
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-abort-relay-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The standalone abort-pattern suite mixes useful OpenClaw regressions with native JavaScript demonstrations and duplicates the helper's reason-preservation assertion.

Why This Change Was Made

Move the two independent bindAbortRelay contracts into the existing fetch-timeout owner suite: event delivery must preserve the default AbortError, and removing the saved relay reference must prevent forwarding. Delete the redundant platform-only binding/timer demonstrations and the repeated raw-bind comparison.

The real foreign-signal fetch adapter still calls the unchanged helper. Its separate suite continues to cover native versus foreign signals and listener cleanup on resolution, rejection, and synchronous failure. The moved tests run outside the timeout suite's fake-clock setup.

User Impact

One fewer collected test file and less misleading test scaffolding. Production behavior is unchanged. The deleted historical commentary did not constitute memory-retention or garbage-collection proof; no such claim is made here.

Evidence

  • Before: node scripts/run-vitest.mjs src/infra/abort-pattern.test.ts src/infra/fetch.test.ts src/utils/fetch-timeout.test.ts passed 48 tests.
  • After: node scripts/run-vitest.mjs src/infra/fetch.test.ts src/utils/fetch-timeout.test.ts passed 45 tests. Exactly three redundant/platform cases were removed; both helper contracts remain.
  • Full changed-file checks, formatting, diff checks, and structured Codex autoreview passed.
  • Production +0/-0; tests +27/-87. Source, caller, sibling tests and history were inspected before removing coverage.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 31, 2026 16:21
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:28 PM ET / 16:28 UTC.

ClawSweeper review

What this changes

The PR deletes a standalone abort-relay test suite and retains its two helper contracts in the fetch-timeout owner suite.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

No introduced correctness or security defect found. Keep this maintainer-labeled PR open for explicit maintainer handling and completion of exact-head checks.

Priority: P3
Reviewed head: 9ecbc8d7b44c024bca00fc37931893642432bab3
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-neutral test consolidation that preserves the helper’s two meaningful contracts.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled, test-only PR leaves production behavior unchanged; its body supplies focused after-change test evidence, while exact-head CI remains pending.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled, test-only PR leaves production behavior unchanged; its body supplies focused after-change test evidence, while exact-head CI remains pending.
Evidence reviewed 6 items Introduced test-only change: The verified PR delta deletes the standalone suite and adds two equivalent relay-contract cases to the owner suite; no production file is changed.
Owner and caller boundary: bindAbortRelay returns a listener-safe bound relay, and the fetch adapter saves that reference for both registration and cleanup.
Retained behavior coverage: The new owner-suite cases assert default AbortError preservation and removal using the saved listener reference; the adapter suite separately covers foreign-signal forwarding and cleanup on resolution, rejection, and synchronous throw.
Findings None None.
Security None None.

How this fits together

The fetch timeout utility provides abort-signal helpers used by the fetch adapter when it adapts foreign signals for native fetch. The moved tests verify that relay behavior before the adapter dispatches network work.

flowchart LR
  A[Foreign abort signal] --> B[Fetch adapter]
  B --> C[Abort relay helper]
  C --> D[Native abort controller]
  D --> E[Fetch implementation]
  F[Owner test suite] --> C
Loading

Decision needed

Question Recommendation
Should this maintainer-owned test consolidation land once exact-head checks and the latest ClawSweeper guidance are confirmed? Accept the consolidation: Land the test-only cleanup after the pending exact-head checks complete and no newer review instruction requires a change.

Why: The diff is behavior-neutral and has no actionable defect, but the protected maintainer label requires explicit human handling rather than automated cleanup.

Before merge

  • Resolve merge risk (P1) - The local checkout could not materialize the fetched current-main source object because its promisor remote was unreachable, so current-main equivalence and the latest ClawSweeper follow-up comment need confirmation before landing.
  • Complete next step (P2) - No mechanical repair is needed; a maintainer should confirm the pending exact-head checks and latest review guidance.
Agent review details

Security

None.

PR surface

Tests -60. Total -60 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 27 87 -60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 27 87 -60

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +27/-87 (net -60) The PR reduces test scaffolding while preserving the two contracts at the helper owner; it does not alter runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the two owner-boundary assertions, keep the dedicated foreign-signal adapter coverage, and land after exact-head CI and the latest review guidance are confirmed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the two owner-boundary assertions, keep the dedicated foreign-signal adapter coverage, and land after exact-head CI and the latest review guidance are confirmed.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR reorganizes existing unit coverage and does not report a current product failure.

Is this the best way to solve the issue?

Yes. The retained assertions now live with the helper that owns the listener contract, while the fetch adapter's foreign-signal and cleanup behaviors remain covered separately.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d27cc02f5981.

Labels

Label changes:

  • add P3: This is a low-risk test-organization cleanup with no user-visible runtime change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled, test-only PR leaves production behavior unchanged; its body supplies focused after-change test evidence, while exact-head CI remains pending.

Label justifications:

  • P3: This is a low-risk test-organization cleanup with no user-visible runtime change.
  • 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: This maintainer-labeled, test-only PR leaves production behavior unchanged; its body supplies focused after-change test evidence, while exact-head CI remains pending.

Evidence

What I checked:

  • Introduced test-only change: The verified PR delta deletes the standalone suite and adds two equivalent relay-contract cases to the owner suite; no production file is changed. (src/utils/fetch-timeout.test.ts:50, 9ecbc8d7b44c)
  • Owner and caller boundary: bindAbortRelay returns a listener-safe bound relay, and the fetch adapter saves that reference for both registration and cleanup. (src/utils/fetch-timeout.ts:27, 9ecbc8d7b44c)
  • Retained behavior coverage: The new owner-suite cases assert default AbortError preservation and removal using the saved listener reference; the adapter suite separately covers foreign-signal forwarding and cleanup on resolution, rejection, and synchronous throw. (src/utils/fetch-timeout.test.ts:50, 9ecbc8d7b44c)
  • Scope and hygiene: The patch is production +0/-0 and tests +27/-87, and git diff --check produced no whitespace errors. (src/infra/abort-pattern.test.ts:1, 9ecbc8d7b44c)
  • Feature-history routing: History identifies the recent fetch/relay implementation work in commit e023b09; shallow/promisor history prevented raw-parent verification of an introducing-line attribution. (src/utils/fetch-timeout.ts:22, e023b0929e6f)
  • Current-main inspection limitation: The fetched-main object required a promisor fetch, but the network was unavailable; this review therefore does not claim an independent current-main source comparison. (d27cc02f5981)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer-directed review accepts this test consolidation. The latest ClawSweeper review found no introduced correctness or security defect. Its current-main verification gap is now resolved: commit ce8ea4a28efa65e8a01edfc2a7536dd3e88c0c02 is materialized locally, and comparison with the PR parent shows no changes in the relay helper, fetch adapter, either retained owner/caller suite, or the deleted demonstration file.

The unchanged PR head passed CI run 33413615172 and native preparation. Local proof passed 48 tests before and 45 after; the difference is exactly three redundant/platform cases, while both actual helper contracts remain. Full changed-file checks and structured Codex review passed. Production +0/-0; tests +27/-87. The latest review guidance has been read and its ordinary review/check-completion steps are addressed. Proceeding through the native merge gate.

@steipete
steipete merged commit 692cb7b into main Aug 31, 2026
173 of 181 checks passed
@steipete
steipete deleted the codex/test-abort-relay-owner branch August 31, 2026 16:36
@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 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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