Skip to content

[Bug]: Heartbeat poll session: direct text reply not delivered to QQ user #90629

Closed as not planned

Description

@gaodaabao

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When OpenClaw receives a heartbeat poll in a QQ channel session, agent's direct text reply does NOT reach the QQ user. The user receives no heartbeat reminders, todo alerts, or email notifications at all.

Use the messagetool explicitly for all heartbeat notifications:
message(action=send, channel="qqbot", target="c2c:USER_ID", message="content")

Steps to reproduce

Configure OpenClaw with qqbot channel (direct message mode)
Set up a heartbeat with HEARTBEAT.mdthat includes proactive checks (email, todos, etc.)
Wait for a heartbeat poll to arrive in the QQ session
In the heartbeat poll handler, reply with text (e.g., todo reminders or email alerts) — do NOT use the messagetool
Check the QQ client: no message is delivered to the user
In contrast, using message(action=send, channel="qqbot", target="c2c:<user_id>", message="content")successfully delivers

Expected behavior

The direct reply text from the agent in a heartbeat poll session should be delivered to the QQ user, just like a normal QQ private message reply.

Actual behavior

Agent sees the heartbeat poll and responds with text (e.g., todo reminders)
QQ user receives nothing
Only explicit messagetool call with channel="qqbot"and target="c2c:<user_id>"successfully delivers messages
This makes heartbeat reminders completely invisible to the user

OpenClaw version

2026.6.1

Operating system

Windows_11

Install method

No response

Model

qianfan/deepseek-v4-flash

Provider / routing chain

openclaw qianfan/deepseek-v4-flash

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Either:
Make heartbeat poll session replies route to the QQ user automatically, OR
Update documentation to clearly state that messagetool must be used (no silent fallback)

Activity

  1. clawsweeper commented on Jun 5, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 20, 2026, 12:37 PM ET / 16:37 UTC.

    Summary
    Keep open: current main and the latest release still keep heartbeat lastTo inheritance behind the same-channel or explicit allow-mismatch guard, and the issue is already paired with an open closing PR that needs maintainer review rather than issue cleanup.

    Reproducibility: no. for the full live QQ user-visible issue: there are no logs, screenshots, API responses, or live QQ proof. The narrower source path is reproducible from current main when heartbeat delivery selects a channel different from lastChannel and lastTo is therefore not inherited without the explicit mismatch flag.

    Ways to help us reproduce this

    • Add expected vs actual behavior.

    Next step
    A new automated fix PR should not be queued while the open linked PR owns the implementation attempt and needs maintainer policy/proof review.

    Review details

    Best possible solution:

    Keep this issue open as the canonical report while maintainers either land a narrow, proof-backed fix or close the linked PR and choose a safer route that preserves the cross-channel guard unless explicitly approved.

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

    No for the full live QQ user-visible issue: there are no logs, screenshots, API responses, or live QQ proof. The narrower source path is reproducible from current main when heartbeat delivery selects a channel different from lastChannel and lastTo is therefore not inherited without the explicit mismatch flag.

    Is this the best way to solve the issue?

    Unclear. A fix belongs in the heartbeat/outbound target resolution path only if maintainers confirm the intended policy for cross-channel heartbeat inheritance; otherwise the safer solution is to preserve the guard and localize the QQ routing or documentation change with live proof.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live QQ C2C heartbeat run, gateway log, QQ API response, screenshot, or recording localizes the full user-visible failure yet.
    • The open candidate PR changes a cross-channel delivery guard and already has message-delivery/security-boundary concerns, so the issue should not close before that policy and proof are settled.
    • The related QQ reconnect issue may share user-visible heartbeat message loss symptoms but reports a different Outbound not configured for channel: qqbot failure path.

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

    Label changes

    Label changes:

    • remove clawsweeper:linked-pr-open: Current issue advisory state no longer selects this label.

    Label justifications:

    • P2: This is a channel-specific heartbeat notification delivery regression with limited blast radius and no evidence of data loss, crash loop, or unusable core runtime.
    • impact:message-loss: The report says heartbeat reminders, todo alerts, and email notifications are produced by the agent but not delivered to the QQ user.
    Evidence reviewed

    Acceptance criteria:

    What I checked:

    • Current main still preserves the mismatch guard: resolveSessionDeliveryTarget only inherits lastTo when the resolved channel matches lastChannel or allowMismatchedLastTo is set; heartbeat mode alone does not bypass that guard. (src/infra/outbound/targets-session.ts:169, 2166652eb3e8)
    • Heartbeat caller reaches the guarded resolver: Heartbeat delivery resolves target and to through resolveSessionDeliveryTarget with mode: "heartbeat"; if the resolver returns no to, heartbeat delivery becomes reason: "no-target". (src/infra/outbound/targets.ts:158, 2166652eb3e8)
    • Heartbeat runner uses the resolved delivery route: The runner builds heartbeat delivery from the main session entry and passes it into resolveHeartbeatDeliveryTargetWithSessionRoute, so session lastChannel/lastTo routing is on the reported path. (src/infra/heartbeat-runner.ts:1487, 2166652eb3e8)
    • Docs define automatic heartbeat delivery as a supported behavior: Heartbeat docs say target: "last" delivers to the last external channel, direct/DM delivery defaults to allow, and target/to control delivery independently from session context. Public docs: docs/gateway/heartbeat.md. (docs/gateway/heartbeat.md:249, 2166652eb3e8)
    • QQBot has a proactive C2C send path: QQBot parses c2c:<openid> and bare openids as C2C targets, and text sends without a reply msgId use sendProactiveMessage, matching the reporter's explicit message-tool workaround path. (extensions/qqbot/src/engine/messaging/sender.ts:391, 2166652eb3e8)
    • Latest release does not contain a newer fix: The latest release tag has the same guard shape in targets-session.ts, so this is not fixed by v2026.6.8. (src/infra/outbound/targets-session.ts:169, 844f405ac1be)

    Likely related people:

    • brandonwise: Commit 455fbc6 added the shared-session cross-channel reply-routing guard and adjacent tests that this issue's proposed fix would need to respect. (role: introduced cross-channel guard; confidence: high; commits: 455fbc6b6def; files: src/infra/outbound/agent-delivery.ts, src/infra/outbound/targets.ts, src/infra/outbound/targets.test.ts)
    • steipete: History shows repeated work on heartbeat direct delivery, fail-closed shared-session routing, and outbound resolver behavior in the same decision surface. (role: recent outbound and heartbeat routing contributor; confidence: high; commits: 885452f5c161, 8a006a32603b; files: src/infra/outbound/targets.ts, src/infra/outbound/targets.test.ts, docs/gateway/heartbeat.md)
    • ZengWen-DT: Commit 6470bb7 substantially changed heartbeat plugin session target handling and tests in the outbound resolver surface. (role: recent heartbeat target contributor; confidence: medium; commits: 6470bb76253b; files: src/infra/outbound/targets.ts, src/infra/outbound/targets.test.ts)
    • cxyhhhhh: The QQBot C2C sender path was substantially refactored in commit 5ccf179, including C2C streaming and message sending behavior used by heartbeat sends. (role: QQ delivery contributor; confidence: medium; commits: 5ccf179a34a9; files: extensions/qqbot/src/channel.ts, extensions/qqbot/src/engine/messaging/sender.ts)
    • Sliverp: Commit bf6f506 introduced the QQ channel implementation that owns the channel-side delivery boundary. (role: QQBot channel introducer; confidence: medium; commits: bf6f506dfae6; files: extensions/qqbot/src/channel.ts)
    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.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    and removed
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    on Jun 5, 2026
  3. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    and removed
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    on Jun 15, 2026
  4. openclaw-barnacle commented on Jul 6, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. openclaw-barnacle commented on Jul 14, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

  6. locked as resolved and limited conversation to collaborators on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.regressionBehavior that previously worked and now failsstaleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions