-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug]: Subagent announce can deliver stale output and subagent sessions may inherit unrelated history #78055
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper 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.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper 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.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Subagent completion delivery appears to have two related failure modes in OpenClaw 2026.5.4:
This is not just noisy output. It produced an unexpected Telegram message to the user around 03:23 BKK with stale Operations-account verification text that was not part of the current conversation.
Environment
2026.5.4 (325df3e)/opt/homebrew/lib/node_modules/openclawagent:main:telegram:default:direct:8455538490openai-codex/gpt-5.5with fallbacksgpt-5.4,gpt-5.4-miniUser-visible symptom
The user received this stale message around 03:23 BKK, 1–2 hours after the relevant Operations setup thread:
It was not part of the live conversation at that time.
Evidence 1: subagent announce delivered stale output to main session
Main session file:
At line 630 /
2026-05-05T20:23:02.686Z(03:23 BKK), OpenClaw injected an inter-session message:At line 631 /
2026-05-05T20:23:06.123Z, the main session sent a normal user-facing answer:That confirms a stale subagent announce was converted into an outbound reply.
Evidence 2: source subagent session had unrelated prior history
Inspecting
agent:main:subagent:8a21843e-95c7-4952-a521-6b09b5c45ed1showed the session did not begin cleanly with the assignedruntime-replay-source-tracetask.It contained older unrelated turns first:
Only later did the subagent receive:
Then it answered the old Operations verification thread:
This response is unrelated to the assigned debugging task. A second investigator subagent (
agent:main:subagent:88edc2fb-6cc1-472c-8919-1bc1f094e5ca) showed the same contamination pattern.Evidence 3: LCM recorded the bad state, but likely did not originate delivery
LCM search finds the stale phrase after the event, but as recorded messages:
msg#536690assistant at 03:22 BKKmsg#536691inter-session/user at 03:23 BKKmsg#536692assistant at 03:23 BKKLCM-specific investigation found duplicated heartbeat text stored as separate assistant messages in LCM conversation 1872, but no synthetic LCM repair rows (
message_parts.is_synthetic=1was 0). Recent compaction summaries did not cover the duplicate window.Current read: LCM is recording already-corrupted/replayed transcript state; the primary bug appears to be upstream session/subagent delivery/history stitching.
Existing related issues
This is related to but not fully covered by:
The distinct piece here is: completion is delivered stale, and the subagent session itself appears to have inherited or reused unrelated prior transcript turns.
Expected behavior
subagent_announceshould not be injected into the requester session as a user-like message if stale or no longer contextually valid.Suggested investigation surfaces
sessions_spawnsession allocation/reuse/session key generationsubagent_announcedelivery freshness checksrole=usersessions_yieldLocal evidence artifact
Full local evidence note: