Skip to content

Heartbeat isolated session relays failed exec notifications and replies in English without SOUL.md persona #67030

@cyrushuang1995-cmyk

Description

@cyrushuang1995-cmyk

Bug Description

When a heartbeat poll creates an isolated session, it can receive async exec completion notifications from a different base session. The isolated session lacks the agent's SOUL.md persona, causing it to respond in English with a generic "I don't see any system messages" reply. This reply is then delivered to the origin chat (e.g. a group chat), confusing users.

Reproduction Steps

  1. Have an active agent with SOUL.md persona configured
  2. Trigger a heartbeat poll while another session has a pending/executing async command
  3. The heartbeat creates an isolated session
  4. The failed/pending exec completion notification from the other session gets forwarded to the heartbeat isolated session
  5. The heartbeat isolated session (without SOUL.md persona) responds in English
  6. The English reply gets delivered to the group chat

Expected Behavior

  • Heartbeat isolated sessions should either:
    • Not receive exec completion notifications from other sessions, OR
    • Include SOUL.md/persona context so replies match the agent's configured personality
    • Silently handle async notifications without generating visible replies

Actual Behavior

  • Heartbeat isolated session receives the notification, has no persona context, replies in English
  • Reply is routed to the origin group chat

Environment

  • OpenClaw version: latest (installed via homebrew)
  • OS: macOS (arm64)
  • Model: various (glm-4.7 in the isolated session)

Key Observations

  • The heartbeatIsolatedBaseSessionKey in the session metadata points to the correct base session
  • The origin field in the session metadata points to the group chat, which is why the reply gets delivered there
  • The exec that triggered the notification was terminated with SIGTERM (model timeout), so there was no actual output to relay
  • The notification template says "An async command you ran earlier has completed. The result is shown in the system messages above." but no system message with the result exists in the isolated session's context

Suggested Fix

  1. Don't relay exec notifications to heartbeat isolated sessions - they should only handle the heartbeat poll
  2. Or: include persona/system prompt in heartbeat isolated sessions so replies match the agent's personality
  3. Or: detect when an isolated session has no prior context and suppress auto-replies to system notifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions