Skip to content

fix(ci): full heartbeat admission proof no longer times out - #120955

Merged
steipete merged 1 commit into
mainfrom
test/heartbeat-reply-admission-timeout
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
test/heartbeat-reply-admission-timeout

Conversation

@steipete

@steipete steipete commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the full-runtime heartbeat reply-admission regression could hit Vitest's generic 120-second case ceiling while it was still actively progressing through the production reply stack. This failed otherwise healthy Node CI and blocked unrelated pull requests.

Why This Change Was Made

The test intentionally keeps the real heartbeat, getReplyFromConfig, reply-agent, admission, and registry-cleanup wiring. It now uses a named 240-second budget scoped only to this one cold full-stack case; no product timeout or runtime behavior changes.

The regression was introduced with the test in #119817 (authored by @licheer-zte, merged by @sallyom). Replacing the runtime seam with a faster mock would weaken the integration contract, so the production path remains unchanged.

User Impact

No user-visible product change. Maintainers get reliable CI coverage for global heartbeat event ownership without false timeouts on cold or loaded runners.

Evidence

  • Reproduced on current-main lineage: the unchanged case ran at roughly 108–119 seconds against a 120-second default and timed out under contention.
  • After: unchanged semantic case passed repeatedly under the scoped budget:
    • 102.58-second test body; 122.01-second Vitest total; 134.73-second wrapper total.
    • 100.43-second test body; 113.35-second Vitest total; 118.87-second wrapper total after rebase.
    • 123.63-second test body; 133.53-second Vitest total; 137.98-second wrapper total after inlining the per-case timeout, directly proving the old 120-second ceiling was insufficient.
  • git diff --check passed.
  • oxfmt --check src/infra/heartbeat-runner.reply-admission.test.ts passed.
  • Codex autoreview: clean, no accepted/actionable findings (0.99).
  • Production LOC: +0/-0. Tests: +76/-69; 68 additions/deletions are formatter-required reindentation from Vitest's direct three-argument per-case form.

Local check:changed guards all passed through the core-test typecheck. The typecheck then hit two unrelated stale-worktree dependency errors (packages/terminal-core/src/ansi.ts arity and missing @openclaw/session-url-contract/parse); exact-head CI uses a fresh dependency snapshot and is the authoritative type gate.

@steipete steipete self-assigned this Aug 9, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 06:32
@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 9, 2026, 2:38 AM ET / 06:38 UTC.

ClawSweeper review

What this changes

The PR gives one cold full-stack heartbeat reply-admission test a named 240-second Vitest case budget instead of the generic 120-second deadline.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for protected maintainer handling. The scoped timeout is the right test-only fix; one P3 cleanup should inline its one-use helper before normal exact-head CI completion.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is narrowly scoped and preserves the intended full-stack coverage; only a non-blocking helper cleanup and normal exact-head checks remain.
Proof confidence 🌊 off-meta tidepool Not applicable: This protected maintainer-authored test-only PR does not require external contributor real-behavior proof; its supplied focused timing runs are supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This protected maintainer-authored test-only PR does not require external contributor real-behavior proof; its supplied focused timing runs are supplemental evidence.
Evidence reviewed 5 items Scoped patch: The branch adds a named 240-second timeout and applies it solely to the cold full-stack admission case; it changes no production code.
Test contract: The test reaches the real configured reply resolver and asserts both agent-specific prompt isolation and selected-event cleanup.
Timeout ownership: Vitest’s shared configuration sets the default case timeout to 120 seconds; infra tests run in isolated non-file-parallel forks, so a per-case override preserves other deadlines.
Findings 1 actionable finding [P3] Inline the one-use timeout helper
Security None None.

How this fits together

Heartbeat processing turns queued system events into agent reply work, then removes only the events consumed by that agent. This regression test exercises that reply-admission and cleanup path for multiple agents sharing a global event queue.

flowchart LR
  A[Queued heartbeat events] --> B[Heartbeat runner]
  B --> C[Reply admission]
  C --> D[Agent reply stack]
  D --> E[Event ownership filter]
  E --> F[Selected-event cleanup]
  F --> G[Full-stack regression test]
Loading

Decision needed

Question Recommendation
Should this protected maintainer PR inline the one-use timeout helper before it proceeds through normal exact-head CI and merge handling? Inline the timeout helper: Call Vitest's existing per-case timeout form directly while retaining the named budget and contract comment.

Why: The remaining change is mechanically small, but the protected maintainer label requires explicit human handling rather than automated closure or merge guidance.

Before merge

  • Inline the one-use timeout helper (P3) - slowIt is only called once and merely forwards Vitest's existing third timeout argument. Call it directly with FULL_REPLY_ADMISSION_TEST_TIMEOUT_MS to keep the scope explicit without adding a parallel test API.
  • Resolve merge risk (P1) - Exact-head checks were still in progress in the supplied PR state, so this is not a landing verdict.

Findings

  • [P3] Inline the one-use timeout helper — src/infra/heartbeat-runner.reply-admission.test.ts:40-41
Agent review details

Security

None.

PR surface

Tests +5. Total +5 across 1 file.

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

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +6/-1 The change is confined to regression-test timing and does not alter runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the named timeout constant and comment, but pass it directly as this test’s Vitest timeout so the full-stack boundary stays covered without adding a parallel test API.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the named timeout constant and comment, but pass it directly as this test’s Vitest timeout so the full-stack boundary stays covered without adding a parallel test API.

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

No independent current-head run was performed in this read-only review; source confirms the 120-second default and the PR body records before/after runs for this isolated case.

Is this the best way to solve the issue?

Yes, scoping the larger timeout to this cold full-stack case is better than changing the global Vitest budget; inline the standard per-test form rather than retain a one-use wrapper.

Full review comments:

  • [P3] Inline the one-use timeout helper — src/infra/heartbeat-runner.reply-admission.test.ts:40-41
    slowIt is only called once and merely forwards Vitest's existing third timeout argument. Call it directly with FULL_REPLY_ADMISSION_TEST_TIMEOUT_MS to keep the scope explicit without adding a parallel test API.
    Confidence: 0.97

Overall correctness: patch is correct
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a low-risk CI regression-test reliability repair with no user-facing 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 protected maintainer-authored test-only PR does not require external contributor real-behavior proof; its supplied focused timing runs are supplemental evidence.

Label justifications:

  • P3: This is a low-risk CI regression-test reliability repair with no user-facing 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 protected maintainer-authored test-only PR does not require external contributor real-behavior proof; its supplied focused timing runs are supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current test lineage is attributed to this contributor at the available history boundary, and this person authored the scoped-timeout branch. (role: recent area contributor; confidence: high; commits: ed760cbcdb2c, a2790be705aa; files: src/infra/heartbeat-runner.reply-admission.test.ts, src/infra/heartbeat-runner-execution.ts)
  • licheer-zte: Authored the merged hook-heartbeat repair whose merge diff added the related admission regression test. (role: related functional-change author; confidence: medium; commits: 42500d13b175; files: src/infra/heartbeat-runner.reply-admission.test.ts)
  • sallyom: The supplied related-PR context identifies this person as the merger/reviewer of the functional heartbeat repair. (role: related merger and reviewer; confidence: medium; commits: 42500d13b175; files: src/infra/heartbeat-runner.reply-admission.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Inline the one-use Vitest wrapper while retaining the named timeout constant and explanatory comment.

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 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact head: a2790be705aa4faf4d88364f9c871d4bd731e35b. Exact-head CI is green; the patch keeps the full production reply-admission wiring unchanged and scopes a 240-second budget only to this cold integration case.

@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the test/heartbeat-reply-admission-timeout branch from a2790be to 7bc31fb Compare August 9, 2026 06:46
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact head: 7bc31fb0cc5df7dcabdd98b5843659d364b59df2. The P3/rank-up move is addressed: the one-use wrapper is gone and the named 240-second budget is passed directly to Vitest. Focused full-production proof is green with a 123.63-second body, directly demonstrating the old 120-second ceiling; exact-head CI is running.

@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 6ad761a into main Aug 9, 2026
104 of 105 checks passed
@steipete
steipete deleted the test/heartbeat-reply-admission-timeout branch August 9, 2026 07:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 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