Skip to content

refactor: share Gateway watch-exit test fixtures - #148237

Merged
steipete merged 1 commit into
mainfrom
codex/r21-watch-exit-tests
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/r21-watch-exit-tests

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Two Gateway watch-exit regression cases duplicate their process fixtures and assertions, making their different settle-window and idle-window behavior harder to maintain together.

User Impact

No runtime behavior changes. Both premature-exit regressions remain covered, including the idle-only CPU observation.

Why This Change Was Made

Use two table rows with fresh mutable fixtures for each case. This removes 43 test lines while preserving case names, order, timing, cleanup and every assertion. No production code or test-only API was added.

Evidence

The complete test file passed on the original and candidate: 22 cases per arm, with identical ordered names and results. The settle row still omits the CPU observer; the idle row creates and asserts its own observer. These are process-fixture tests, not a live Gateway measurement.

node scripts/run-vitest.mjs test/scripts/check-gateway-watch-regression.test.ts --reporter=verbose --reporter=json

Targeted formatting, the selected changed-file checks and git diff --check passed. Fresh independent review was clean. All proof processes joined, and the committed source matches the reviewed and tested candidate.

@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@steipete
steipete marked this pull request as ready for review September 14, 2026 12:11
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 14, 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 Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 8:33 AM ET / 12:33 UTC.

ClawSweeper review

What this changes

Combines the Gateway watch settle-window and idle-window exit tests into two table-driven cases while preserving separate fixtures and assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, behavior-preserving test cleanup that is absent from current main. No actionable correctness defect was found, and the maintainer-authored, protected PR is not eligible for cleanup closure.

Priority: P3
Reviewed head: 8bbe0d4d9d504a859a2bd59ac23db001aa831dc1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused cleanup preserves both regression paths and fixture isolation, with relevant before/after validation reported.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR changes only fixtures exercising the existing watch checker; the reported before/after 22-case comparison is relevant supplemental validation, and no runtime proof gate applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR changes only fixtures exercising the existing watch checker; the reported before/after 22-case comparison is relevant supplemental validation, and no runtime proof gate applies.
Evidence reviewed 5 items Introduced change preserves both cases: The pinned merge-base-to-head patch retains both timings, next-tick exit injection, independent mutable fixtures, cleanup, all shared assertions, and the idle-only CPU observer assertion.
Production behavior matches the retained scenarios: The complete checker was inspected. A settle-window exit bypasses CPU sampling; an idle-window exit follows the initial CPU sample and bypasses the ending sample and planned stop. The patch does not change this owner.
Cleanup remains absent from current main: Fetched main still contains the two separate tests. Its checker and test file match the PR merge-base versions, so this consolidation remains distinct work; no shipped implementation is claimed.
Findings None None.
Security None None.

How this fits together

The Gateway watch regression checker monitors readiness, premature process exits, and idle CPU usage. These tests inject process events into that checker and verify its diagnostic results.

flowchart TD
  A[Two exit scenarios] --> B[Fresh process fixtures]
  B --> C[Gateway watch checker]
  C --> D{Exit phase}
  D --> E[Settle before CPU sampling]
  D --> F[Idle after one CPU sample]
  E --> G[Assert unplanned exit and cleanup]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -43. Total -43 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 59 102 -43
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 59 102 -43

Review metrics

None.

Technical review

Best possible solution:

Keep the shared table-driven fixture with both phase-specific scenarios and the idle-only CPU assertion intact.

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

Not applicable: this PR removes duplicated test setup rather than fixing a reported runtime defect; both original scenarios remain identifiable in source.

Is this the best way to solve the issue?

Yes: the table preserves scenario differences and creates fixtures inside each invocation, reducing duplication without adding a production seam.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a9d0823d56a6.

Labels

Label changes:

  • add P3: This consolidates existing test fixtures without changing runtime behavior or coverage.
  • 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: The maintainer-authored PR changes only fixtures exercising the existing watch checker; the reported before/after 22-case comparison is relevant supplemental validation, and no runtime proof gate applies.

Label justifications:

  • P3: This consolidates existing test fixtures without changing runtime behavior or coverage.
  • 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 maintainer-authored PR changes only fixtures exercising the existing watch checker; the reported before/after 22-case comparison is relevant supplemental validation, and no runtime proof gate applies.

Evidence

What I checked:

  • Introduced change preserves both cases: The pinned merge-base-to-head patch retains both timings, next-tick exit injection, independent mutable fixtures, cleanup, all shared assertions, and the idle-only CPU observer assertion. (test/scripts/check-gateway-watch-regression.test.ts:520, 8bbe0d4d9d50)
  • Production behavior matches the retained scenarios: The complete checker was inspected. A settle-window exit bypasses CPU sampling; an idle-window exit follows the initial CPU sample and bypasses the ending sample and planned stop. The patch does not change this owner. (scripts/check-gateway-watch-regression.mts:594, 8bbe0d4d9d50)
  • Cleanup remains absent from current main: Fetched main still contains the two separate tests. Its checker and test file match the PR merge-base versions, so this consolidation remains distinct work; no shipped implementation is claimed. (test/scripts/check-gateway-watch-regression.test.ts:520, a9d0823d56a6)
  • Validation evidence and review limits: The supplied complete PR body reports 22 passing cases on each arm with identical ordered names and results, plus formatting and changed-file checks. These are explicitly process-fixture tests, not live Gateway proof. This read-only review did not execute tests; the pinned diff passed git diff --check and the checkout remained clean. (test/scripts/check-gateway-watch-regression.test.ts, 8bbe0d4d9d50)
  • Area-history routing: Current-main file history includes Peter Steinberger's tooling refactors and Vincent Koc's runtime-growth regression work. Exact line attribution could not be established because blame encountered an unavailable historical object; these are routing candidates, not verified introducers. (test/scripts/check-gateway-watch-regression.test.ts, a9d0823d56a6)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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
steipete merged commit a892956 into main Sep 14, 2026
119 of 120 checks passed
@steipete
steipete deleted the codex/r21-watch-exit-tests branch September 14, 2026 15:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit '3c08384584f57787a26da9998488233fc15ccf7e': (122 commits)
  fix(agents): keep tool result summaries when middleware details exceed shape limits (#147805)
  test: make full-suite fixtures portable across runtimes (#148247)
  refactor(qa): share unknown confidence results (#148200)
  chore(android): remove unused test dependencies and duplicate Wear settings (#148231)
  test: reuse compiled preflight in startup fixtures (#148330)
  test(wizard): route recovery integration through database forks (#148337)
  refactor(plugins): simplify provider auth patch recursion (#147933)
  fix(cli): drain failed web capability output (#148234)
  refactor(android): remove unused production helpers (#148233)
  fix(plugins): scope feed integrity to hosted ClawHub (#148220)
  test(qa): compare Telegram entities semantically (#148219)
  test(qa): recognize native Slack exec progress rows (#148217)
  test(cron): distinguish repeated delivery incidents (#148151)
  test(qa): preserve restart command ownership (#148218)
  test(qa): isolate bundled skill CLI gateway state (#148150)
  test(qa): align process lifecycle contracts (#148149)
  improve(media): reduce metadata fetched during orphan cleanup (#148244)
  fix(matrix): retain sync state runtime for deferred persistence (#148152)
  test: deduplicate gateway watch exit fixtures (#148237)
  refactor(cli): derive daemon status contract from gatherer (#148108)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 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