Skip to content

fix: ignore reasoning-only heartbeat ack blocks - #95912

Closed
arkyu2077 wants to merge 1 commit into
openclaw:mainfrom
arkyu2077:fix/issue-95796
Closed

arkyu2077 wants to merge 1 commit into
openclaw:mainfrom
arkyu2077:fix/issue-95796

Conversation

@arkyu2077

Copy link
Copy Markdown
Contributor

Summary

Allow heartbeat transcript pruning to keep working when an otherwise short HEARTBEAT_OK acknowledgement is wrapped with provider reasoning/thinking blocks.

Changes

  • treat reasoning and thinking blocks as ignorable metadata for heartbeat ACK detection
  • keep rejecting heartbeat ACKs that also contain other non-text payloads like images or tools
  • add regression coverage for direct ACK detection and transcript-span pruning

Testing

  • pnpm test -- --run src/auto-reply/heartbeat-filter.test.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-injection.test.ts

Fixes #95796

@clawsweeper

clawsweeper Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: this PR targets a real heartbeat transcript-filter bug, but it is superseded by the open proof-positive candidate at #95798, which covers the same behavior plus the repository-supported redacted_thinking block shape.

Root-cause cluster
Relationship: superseded
Canonical: #95798
Summary: This PR is one of several candidate fixes for the same heartbeat reasoning-block ACK pruning bug, and the open proof-positive sibling is the safer canonical landing path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this branch and keep review focused on #95798 as the canonical heartbeat-filter fix, then close the linked bug after one candidate lands.

So I’m closing this here and keeping the remaining discussion on #95798.

Review details

Best possible solution:

Close this branch and keep review focused on #95798 as the canonical heartbeat-filter fix, then close the linked bug after one candidate lands.

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

Yes. Source inspection shows an assistant content array with a reasoning/thinking block plus HEARTBEAT_OK text sets hasNonTextContent and makes isHeartbeatOkResponse return false before transcript pruning can remove the heartbeat span.

Is this the best way to solve the issue?

No. This PR is in the right classifier layer, but the best landing path is the proof-positive sibling that also covers redacted_thinking while preserving the non-text safety guard.

Security review:

Security review cleared: Cleared: the diff only changes deterministic heartbeat message classification and colocated tests, with no dependency, workflow, secret, or code-execution surface changes.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • nxmxbbd: Authored merged PR 60998, which introduced the heartbeat context filtering path and initial heartbeat-filter tests. (role: introduced behavior; confidence: high; commits: 57f9f0a08dd7, 61d18da95285; files: src/auto-reply/heartbeat-filter.ts, src/auto-reply/heartbeat-filter.test.ts)
  • obviyus: Merged PR 60998 and authored cleanup/test distillation commits that shaped the landed heartbeat-filter baseline. (role: merger and adjacent contributor; confidence: medium; commits: 57f9f0a08dd7, a0625a9831fb, 80ac5d4ae2de; files: src/auto-reply/heartbeat-filter.ts, src/auto-reply/heartbeat-filter.test.ts)
  • fuller-stack-dev: Authored merged PR 83477, which expanded heartbeat transcript artifact filtering and tests around the same helper. (role: recent adjacent feature contributor; confidence: medium; commits: 2ab3a4e422a0, 11e6f4308bea, 8e0daa2dff07; files: src/auto-reply/heartbeat-filter.ts, src/auto-reply/heartbeat-filter.test.ts, src/agents/embedded-agent-runner/run/attempt.ts)
  • lin-hongkuan: Current-main blame for the touched helper region points to commit 67118d5, though history shows this is recent broad churn rather than original ownership. (role: recent area contributor; confidence: low; commits: 67118d5ab912; files: src/auto-reply/heartbeat-filter.ts, src/auto-reply/heartbeat-filter.test.ts)

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

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 23, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Jun 28, 2026
@steipete steipete closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Heartbeat transcript filtering ignores HEARTBEAT_OK when assistant message contains reasoning/thinking block

2 participants