Skip to content

fix(heartbeat): suppress stream-error placeholders#97364

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
TurboTheTurtle:fix/97357-heartbeat-placeholder
Jun 28, 2026
Merged

fix(heartbeat): suppress stream-error placeholders#97364
vincentkoc merged 1 commit into
openclaw:mainfrom
TurboTheTurtle:fix/97357-heartbeat-placeholder

Conversation

@TurboTheTurtle

@TurboTheTurtle TurboTheTurtle commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Closes #97357.

What Problem This Solves

Heartbeat fallback replies that echo only the internal stream-error sentinel are non-empty, so current main can normalize and deliver them as visible channel messages. This filters the placeholder-only heartbeat case before durable delivery while leaving the persisted replay sentinel untouched.

Summary

  • Suppress heartbeat replies whose visible text is only the internal stream-error fallback sentinel, including repeated echoes, before durable channel delivery.
  • Preserve normal heartbeat delivery behavior, including runner failure copy rewrite and exec-completion fallback for non-placeholder content.

Evidence

  • Added src/infra/heartbeat-runner.tool-response.test.ts coverage showing a repeated sentinel heartbeat reply produces no Telegram send and records an ok-token heartbeat event.
  • Verified the focused heartbeat runner regression suite, heartbeat token suite, formatter check, and whitespace check locally.
  • Redacted local heartbeat/channel proof using the real runHeartbeatOnce path and Telegram outbound adapter, with the network send hook recording attempts:
result.status=ran
telegram.send.count=0
heartbeat.event.status=ok-token
heartbeat.event.silent=true
placeholder.delivered=false

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 1:25 AM ET / 05:25 UTC.

Summary
The branch imports the shared stream-error sentinel, suppresses placeholder-only heartbeat replies before durable channel delivery, preserves media and exec-completion paths, and adds Telegram heartbeat regression coverage.

PR surface: Source +35, Tests +31. Total +66 across 2 files.

Reproducibility: yes. at source level: current main treats repeated stream-error sentinel text as non-empty heartbeat reply text that can reach durable delivery. The linked issue supplies released-version field evidence, and the PR adds focused current-path regression coverage.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #97357
Summary: This PR is the candidate fix for the linked heartbeat placeholder delivery issue; adjacent sentinel/provider issues remain separate work.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair job is needed because no actionable patch defect was found; the remaining action is ordinary maintainer review and landing.

Security
Cleared: The diff only changes heartbeat normalization and a regression test; it adds no dependencies, workflow changes, secret handling, or new code-execution surface.

Review details

Best possible solution:

Land the narrow heartbeat normalization fix after ordinary maintainer review, and leave broader provider fallback diagnostics and chat-history sentinel display work to their separate tracked items.

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

Yes at source level: current main treats repeated stream-error sentinel text as non-empty heartbeat reply text that can reach durable delivery. The linked issue supplies released-version field evidence, and the PR adds focused current-path regression coverage.

Is this the best way to solve the issue?

Yes: filtering the canonical sentinel in heartbeat normalization is the narrowest maintainable layer because channel delivery should not learn provider/session sentinel semantics and the persisted replay sentinel must remain intact. The PR also handles the important exec-completion fallback edge case so suppression is not undone later in the runner.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied redacted after-fix output from the real runHeartbeatOnce path with Telegram outbound send attempts showing no placeholder delivery.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied redacted after-fix output from the real runHeartbeatOnce path with Telegram outbound send attempts showing no placeholder delivery.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a focused fix for a user-visible heartbeat/channel delivery bug with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied redacted after-fix output from the real runHeartbeatOnce path with Telegram outbound send attempts showing no placeholder delivery.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied redacted after-fix output from the real runHeartbeatOnce path with Telegram outbound send attempts showing no placeholder delivery.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR affects visible Telegram heartbeat delivery in the regression path, so a short Telegram Desktop proof is useful and the existing Mantis label is appropriate.
Evidence reviewed

PR surface:

Source +35, Tests +31. Total +66 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 43 8 +35
Tests 1 31 0 +31
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 74 8 +66

What I checked:

  • Root policy applied: Root review policy requires whole-path source review, proof checks for channel-visible changes, and scoped guidance before verdict; those requirements shaped this review. (AGENTS.md:1, 69af58ba2613)
  • Scoped Telegram guidance applied: The Telegram maintainer note makes real Telegram-visible proof relevant for user-visible Telegram delivery changes; this PR remains suitable for the Telegram proof label even though the patch is in heartbeat normalization. (.agents/maintainer-notes/telegram.md:31, 69af58ba2613)
  • Current-main normalization gap: On current main, normalizeHeartbeatReply strips heartbeat ACK tokens and prefixes but returns repeated stream-error sentinel text as sendable non-empty text. (src/infra/heartbeat-runner.ts:842, 69af58ba2613)
  • Current-main durable delivery path: The heartbeat runner passes normalized text into sendDurableMessageBatch payloads unless the main reply is skipped, so placeholder-only text can reach channel delivery on main. (src/infra/heartbeat-runner.ts:2099, 69af58ba2613)
  • Sentinel contract: STREAM_ERROR_FALLBACK_TEXT is the canonical persisted assistant stream-error sentinel, so the PR correctly filters the visible heartbeat output path without removing the replay sentinel contract. (src/agents/stream-message-shared.ts:80, 69af58ba2613)
  • PR-head suppression logic: The PR classifies placeholder-only stream-error text after heartbeat token stripping and carries isInternalPlaceholderOnly through the exec-completion fallback and skip decision. (src/infra/heartbeat-runner.ts:850, 814e0fb8a1a1)

Likely related people:

  • tangtaizong666: Authored recent heartbeat reply selection work that changed the runner and the reply payload selector adjacent to this PR's normalization boundary. (role: recent heartbeat reply selector contributor; confidence: high; commits: 43890ebc3b25; files: src/infra/heartbeat-runner.ts, src/auto-reply/heartbeat-reply-payload.ts)
  • joshavant: Recent heartbeat delivery and failure-copy history touches the same runner/test surface and the adjacent failure-output path this PR preserves. (role: recent heartbeat delivery contributor; confidence: high; commits: 3643de4ba7b6, 39a9a3478f11, bd9c78f957b8; files: src/infra/heartbeat-runner.ts, src/infra/heartbeat-runner.tool-response.test.ts)
  • openperf: Introduced the shared stream-error sentinel contract that this PR filters from visible heartbeat delivery while preserving replay safety. (role: sentinel contract contributor; confidence: high; commits: 930d81aa41d2; files: src/agents/stream-message-shared.ts, src/agents/session-file-repair.ts)
  • vincentkoc: Co-authored/reviewed recent heartbeat reply selector work and previously authored plugin SDK reply payload routing used by the delivery path. (role: adjacent reviewer and reply-payload contributor; confidence: medium; commits: 43890ebc3b25, ef1346e50339; files: src/auto-reply/heartbeat-reply-payload.ts, src/plugin-sdk/reply-payload.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 28, 2026
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 28, 2026
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@openclaw-mantis telegram desktop proof: verify a heartbeat reply containing only repeated stream-error placeholder text is not delivered visibly, while normal heartbeat content still sends.

@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 28, 2026 05:23 Inactive
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed 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. labels Jun 28, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured Telegram Desktop before/after GIFs showing the heartbeat placeholder message on Main and no new placeholder message on this PR.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-97364/run-28312408122-1/index.json

chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 2, 2026
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

Heartbeat fallback can deliver repeated internal stream-error placeholders

2 participants