Repository navigation
fix: same-session inferred commitments can be starved indefinitely when a normal HEARTBEAT.md... - #75469
fix: same-session inferred commitments can be starved indefinitely when a normal HEARTBEAT.md...#75469clawsweeper[bot] wants to merge 8 commits into
Conversation
|
Codex review: found issues before merge. Reviewed July 3, 2026, 10:04 PM ET / July 4, 2026, 02:04 UTC. Summary PR surface: Source +34, Tests +195. Total +229 across 2 files. Reproducibility: yes. source-reproducible: current main selects task prompts when due tasks exist, keeps due commitments out of that run, and then skips default-session fan-out. I did not run tests because this review is read-only. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Refresh the branch into a narrow heartbeat-runner change that runs a same-session Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main selects task prompts when due tasks exist, keeps due commitments out of that run, and then skips default-session fan-out. I did not run tests because this review is read-only. Is this the best way to solve the issue? No, this PR is not the best merge vehicle as-is. The requested behavior is still needed, but the implementation should be refreshed onto current main's Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a1063aa4c83f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +34, Tests +195. Total +229 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
46af05b to
67c8ef1
Compare
4cc80ec to
8a8a40e
Compare
8a8a40e to
3823dc1
Compare
|
Heads up: this PR needs to be updated against current |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof. Reviewed head: Maintainer decision needed:
Mantis proof suggestion: |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thank you for identifying the same-session commitment starvation. I independently reproduced it against current main with the actual cron-monitor wake, SQLite commitment store, heartbeat prompts, and Telegram delivery. The canonical scheduler-owner fix has now landed in #115581 (5d55258): pending default-session commitments receive the existing tools-disabled follow-up, while already-delivered commitments are never sent twice. The first-failing regression, 65 cross-surface tests, complete changed gate, and exact-head CI all pass. Closing this older implementation as superseded by the landed canonical fix; thank you for the original report. |
Summary
Found one regression risk: same-session inferred commitments can be starved indefinitely when a normal
HEARTBEAT.mdtask is due on every heartbeat tick.What ClawSweeper Is Fixing
src/infra/heartbeat-runner.ts:1024firstDueCommitmentis now only selected whendueHeartbeatTasks.length === 0(src/infra/heartbeat-runner.ts:1024). When any task is due,resolveHeartbeatRunPromptreturns the task prompt withhasDueCommitments: false(src/infra/heartbeat-runner.ts:870), sodueCommitmentIdsis empty and the commitment is neither attempted nor delivered. The scheduler’s follow-up pass explicitly skips the default session key (src/infra/heartbeat-runner.ts:1866), so same-session commitments depend on a later default heartbeat run with no due tasks. For a documented/common setup likeheartbeat.every: "5m"and atasks:entry withinterval: 5m,isTaskDueis true again on every cadence tick because it usesnowMs - lastRunMs >= intervalMs(src/auto-reply/heartbeat.ts:288). The new test covers the first half of this state by asserting the due commitment stayspendingwith `attempts...Expected Repair Surface
src/infra/heartbeat-runner.tssrc/infra/heartbeat-runner.commitments.test.tsSource And Review Context
ClawSweeper report: https://github.com/openclaw/clawsweeper/blob/main/records/openclaw-openclaw/commits/955a0e9c0f7d969e7d96cade7b383b3306aadf98.md
Commit under review: 955a0e9
Latest main at intake: 7340c03
Original commit author: clawsweeper[bot]
GitHub author: @clawsweeper[bot]
Highest severity: medium
Review confidence: high
Diff:
173f959613b35195c8e4e662b9e0138831cfb4d2..955a0e9c0f7d969e7d96cade7b383b3306aadf98Changed files:
src/infra/heartbeat-runner.ts,src/infra/heartbeat-runner.commitments.test.tsCode read: changed files in full, task parsing/due logic, commitment store selection/status updates, heartbeat wake/scheduler loop, heartbeat and commitment docs.
PR metadata: associated PR
75344reviewed viagh.Expected validation
pnpm check:changedClawSweeper already ran:
pnpm docs:listcompleted.git diff --check 173f959613b35195c8e4e662b9e0138831cfb4d2..955a0e9c0f7d969e7d96cade7b383b3306aadf98passed.node_moduleswas missing;pnpm installsucceeded.pnpm test src/infra/heartbeat-runner.commitments.test.ts src/infra/heartbeat-runner.returns-default-unset.test.tspassed: 41 tests.Known review limits:
tsxsmoke attempt was stopped because importing the runner staged bundled plugin runtime dependencies and did not reach scenario output quickly enough.ClawSweeper Guardrails
mainbefore changing code.ClawSweeper 🐠 replacement reef notes:
fish notes: model gpt-5.5, reasoning medium; reviewed against 46af05b.