Repository navigation
test(heartbeat): heartbeat live suite never sees the forced monitor poll - #176715
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR refreshes cross-process session reads, corrects heartbeat fixture instructions, and waits for completion settlement before comparing transcripts. Example: Force the heartbeat monitor for agent:main:main after a foreground command completes.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a source-supported live-test failure still present on main, preserves transcript-isolation coverage, and introduces no identified defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe live suite starts an isolated Gateway, drives background command completions and scheduled heartbeats, then checks persisted transcripts for correct session routing. flowchart TD
A[Live test] --> B[Child Gateway]
B --> C[Background command completion]
B --> D[Heartbeat monitor]
C --> E[Foreground session transcript]
D --> F[Main session transcript]
E --> G[Fresh reads and isolation assertions]
F --> G
Technical reviewBest possible solution: Retain this focused fixture repair using existing reader and session-lifecycle owners. Do we have a high-confidence way to reproduce the issue? The fixture and reader implementation establish the stale cross-process observation path, while the body reports live failures; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch uses an existing fresh-read mode and documented reply semantics, strengthens settlement checks, and preserves the routing invariant without additional production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 64e9443af525. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +5. Total +5 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 9:07 PM ET / October 19, 2026, 01:07 UTC. |
Read fresh session snapshots when observing the child Gateway. Retained exact-row facts introduced in #168316 use in-process write receipts and can retain the initial absence of main after a forced monitor has written its transcript. Use an automatic-reply heartbeat prompt for the openclaw runtime instead of invoking its disabled structured response tool. Preserve the main-session poll and reply assertions and the foreground transcript isolation check.
Internal dashboard sessions require a final result. NO_REPLY starts bounded required-result recovery, so observing that row alone can snapshot an unfinished continuation. Request the completion marker and wait for no active run before validating the last reply. Keep the exact post-monitor foreground transcript assertion. Offline loopback proof reproduced seven-to-eight transcript growth with one exec-completion input and one admitted run ID: NO_REPLY followed by required-result recovery. Main monitoring left the held foreground transcript unchanged. Returning the result directly needed one response and preserved the settled transcript across monitoring. See docs/concepts/messages.md silent replies contract. Validation: gated loopback cases passed; targeted oxlint, oxfmt, diff check, and independent review passed. The existing source-reply-retry test command stalled during module collection and was stopped without a test verdict. The reported different live run ID was not reproduced offline. No live credentials or operator Gateway used.
726812d to
d67efa1
Compare
|
Merged via squash.
|
…oll (openclaw#176715) * test(heartbeat): fix empty forced-monitor transcript reads Read fresh session snapshots when observing the child Gateway. Retained exact-row facts introduced in openclaw#168316 use in-process write receipts and can retain the initial absence of main after a forced monitor has written its transcript. Use an automatic-reply heartbeat prompt for the openclaw runtime instead of invoking its disabled structured response tool. Preserve the main-session poll and reply assertions and the foreground transcript isolation check. * test(heartbeat): wait for settled internal completion results Internal dashboard sessions require a final result. NO_REPLY starts bounded required-result recovery, so observing that row alone can snapshot an unfinished continuation. Request the completion marker and wait for no active run before validating the last reply. Keep the exact post-monitor foreground transcript assertion. Offline loopback proof reproduced seven-to-eight transcript growth with one exec-completion input and one admitted run ID: NO_REPLY followed by required-result recovery. Main monitoring left the held foreground transcript unchanged. Returning the result directly needed one response and preserved the settled transcript across monitoring. See docs/concepts/messages.md silent replies contract. Validation: gated loopback cases passed; targeted oxlint, oxfmt, diff check, and independent review passed. The existing source-reply-retry test command stalled during module collection and was stopped without a test verdict. The reported different live run ID was not reproduced offline. No live credentials or operator Gateway used.
What Problem This Solves
Fixes: the heartbeat live suite (
src/infra/heartbeat-runner.live.test.ts) fails on every run on main. Its success case times out because it never sees the forced heartbeat monitor's main-session poll, even though the Gateway wrote it.User Impact
User impact: no product change. Maintainers get a heartbeat live suite that passes on a healthy build and still proves that monitor polls stay on the main session and never touch the foreground transcript.
Why This Change Was Made
Three test-side problems, verified offline against a real Gateway with a loopback model:
[]after the Gateway wrote the poll and reply. Cross-process observations now useexactRead: false.heartbeat_respond. The default automatic-reply heartbeat runtime offers that tool but rejects calls to it, so the prompt now asks for a plain reply.NO_REPLYand then receive the required-result recovery reply in the same run (docs/concepts/messages.md). The test now waits for the session to settle (hasActiveRun: falseplus the final reply) before snapshotting the foreground transcript.The post-monitor transcript-isolation assertion is unchanged.
Noticed but out of scope: when
heartbeat_respondis rejected during an actual heartbeat run in automatic-reply mode, its error message says it is "only accepted during a heartbeat run", which misleads the model.Evidence
[]after the forced monitor); the watcher-failure case passed.cron.runsok/succeeded). A fresh read shows[OpenClaw heartbeat poll]plus the reply on main, while the cached read showed[].