Skip to content

[Bug]: Hallucination Loop — Agent Generated Irrelevant Multi-Thousand-Word Responses Across 2 Simultaneous Sessions #87029

Closed as not planned

Description

@myfreedompeptides-bot

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Bug] Hallucination Loop — Agent Generated Irrelevant Multi-Thousand-Word Responses Across 2 Simultaneous Sessions

OpenClaw Version: 2026.5.6 (c97b9f7)

Date/Time Window: Tue May 26, 2026, ~19:02–19:06 UTC

Channel: Telegram (direct chat)

Model/Provider: anthropic/claude-sonnet-4-6

What happened:
The agent (main session) went into an uncontrolled hallucination loop across 2 simultaneous Telegram chats. It began generating completely irrelevant, multi-thousand-word responses about Portugal, Madeira, the Azores, Portuguese cuisine, and history — none of which had any relation to the active conversation. Both chats were handled by the same agent instance. The user had to send "Stop" multiple times to intervene.

Impact:

• Significant wasted output tokens across both sessions
• Required repeated manual user intervention to stop
• Occurred simultaneously on 2 sessions — suggests it may not be an isolated model fluke

Diagnostics: Attaching openclaw-diagnostics.zip (sanitized, payload-free)

Credits question: Tokens were billed through user's own Anthropic API key — if there's a path to review/credit through OpenClaw's billing support, please advise.

Steps to reproduce

openclaw-diagnostics.zip

Expected behavior

openclaw-diagnostics.zip

Actual behavior

openclaw-diagnostics.zip

OpenClaw version

2026.5.6 (c97b9f7)

Operating system

Linux 6.12.74+deb13+1-amd64 (x64)

Install method

No response

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

Routing Chain: Telegram → OpenClaw Gateway → anthropic/claude-sonnet-4-6 (via Anthropic API, api-key auth) Full routing for the issue: • Inbound: Telegram direct chat • Gateway: OpenClaw 2026.5.6 (c97b9f7) on Linux/x64 • Runtime: OpenClaw Pi Default • Provider: Anthropic (api-key, env: ANTHROPIC_API_KEY) • Model: anthropic/claude-sonnet-4-6 • Execution: direct (no proxy) Paste that in the routing chain field and you're done! 🙏

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. clawsweeper commented on May 26, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 24, 2026, 3:47 PM ET / 19:47 UTC.

    Summary
    Keep open: the report is credible and current main has adjacent Telegram/session safeguards, but neither current main nor the latest release proves the two-simultaneous-chat irrelevant-output/session-drift incident is fixed or fully owned by another tracker.

    Reproducibility: no. The diagnostics prove a real Telegram send burst and recovery window, but the payload-free export omits the raw content, trigger, and two-chat context needed for a high-confidence current-main reproduction.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    Manual review is needed because the remaining boundary crosses Telegram delivery, default DM scoping, session-state isolation, and semantic loop policy.

    Review details

    Best possible solution:

    Keep this as the concrete Telegram cross-session incident until maintainer review can separate DM scoping/config behavior, duplicate delivery/replay, and any needed semantic runaway-output guard.

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

    No. The diagnostics prove a real Telegram send burst and recovery window, but the payload-free export omits the raw content, trigger, and two-chat context needed for a high-confidence current-main reproduction.

    Is this the best way to solve the issue?

    Unclear. The best fix may be config guidance, a session-routing change, a delivery/replay fix, or a semantic loop guard, and maintainers need to choose that boundary before an automated patch.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The diagnostic export intentionally omits raw chat text, prompts, and unredacted chat identities, so the Portugal/Madeira/Azores content and exact two-chat contamination cannot be independently reproduced.
    • Current code and docs make shared direct-message state a documented default unless dmScope is configured, so maintainers need to decide whether this incident is a config/support outcome, a runtime routing bug, or a new safety guard requirement.
    • Adjacent Telegram duplicate-delivery trackers do not cover the semantic irrelevant-output claim, so closing this as a duplicate would lose a distinct session-state signal.

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

    Label changes

    Label changes:

    • add issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.
    • remove issue-rating: 🦐 gold shrimp: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: The report describes uncontrolled long Telegram output across simultaneous chats requiring repeated user intervention.
    • impact:session-state: The central concern is possible cross-chat context/session drift while two Telegram chats shared one agent instance.
    • impact:message-loss: The incident involved visible Telegram output sent to the wrong or unintended conversational flow, disrupting normal message delivery.
    Evidence reviewed

    What I checked:

    • Repository policy read: Root and relevant scoped AGENTS.md files were read; the review applied the policy requiring source, current behavior, docs, related-thread, and history checks before cleanup. (AGENTS.md:11, fa6a9509bc95)
    • Diagnostic bundle supports a real burst but omits payloads: The attached diagnostics are payload-free and show direct Telegram inbound messages from 19:02-19:06 UTC, four direct outbound sends at 19:03:57-19:04:00, an Anthropic failover decision at 19:06:40, and a later larger Telegram outbound/reconnect-drain burst around 19:08-19:09.
    • Current default DM behavior can share sessions: Current route resolution defaults dmScope to main, and docs state that main means all DMs share one session while per-channel-peer is the recommended isolation mode. (src/routing/resolve-route.ts:624, fa6a9509bc95)
    • Secure DM docs describe the config boundary: Docs say local onboarding writes session.dmScope per-channel-peer when unset, but the product default remains main, which makes the two-chat/session-state part a product/config boundary rather than an implemented close. Public docs: docs/gateway/security/index.md. (docs/gateway/security/index.md:586, fa6a9509bc95)
    • Telegram context has isolated-session coverage only when configured: Current tests prove Telegram direct messages isolate by sender when session.dmScope is per-channel-peer, but the reporter's sanitized config did not include a session.dmScope entry. (extensions/telegram/src/bot-message-context.dm-threads.test.ts:383, fa6a9509bc95)
    • Adjacent final-payload and route-dedupe safeguards exist: Current code suppresses final payloads only after successful block streaming and scopes message-tool dedupe to channel/account/thread route evidence; that addresses duplicate-delivery classes but not semantic irrelevant content or exact cross-session drift. (src/auto-reply/reply/agent-runner-payloads.ts:285, fa6a9509bc95)

    Likely related people:

    • vincentkoc: Live GitHub path history shows recent work on reply payloads, routing/session helpers, and delivery recovery surfaces adjacent to this report. (role: recent area contributor; confidence: medium; commits: 54c0048d6c9c, c782fa98aa88, 056e5b6b07c0; files: src/auto-reply/reply/agent-runner-payloads.ts, src/infra/outbound/delivery-queue-recovery.ts, src/routing/session-key.ts)
    • sandieman2: Commit c67dc59 changed final reply delivery and routed-thread dedupe in the same payload/dedupe surfaces implicated by Telegram duplicate or suppressed replies. (role: adjacent reply-dedupe contributor; confidence: high; commits: c67dc59b02b0; files: src/auto-reply/reply/agent-runner-payloads.ts, src/auto-reply/reply/reply-payloads-dedupe.ts)
    • obviyus: Recent Telegram path history ties this handle to stable topic sessions, live claim recovery, polling conflict handling, and restart/recovery behavior adjacent to the diagnostics. (role: recent Telegram contributor; confidence: medium; commits: b75d1a0b85b0, dc09324ec2e1, d4819948f37d; files: extensions/telegram/src/bot-message-context.ts, extensions/telegram/src/conversation-route.ts, extensions/telegram/src/polling-session.ts)
    • steipete: History shows work on durable outbound lifecycle, route/session docs, and loop/recovery-adjacent architecture that informs the product boundary for this issue. (role: adjacent architecture contributor; confidence: medium; commits: 2ead1502c9bf, 9b30ff181c14, e0fafdcc1d1d; files: src/infra/outbound/delivery-queue-recovery.ts, src/routing/resolve-route.ts, src/agents/tool-loop-detection.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
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    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.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    and removed
    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.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    on Jun 15, 2026
  3. openclaw-barnacle commented on Jul 9, 2026

    @openclaw-barnacle

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

  4. openclaw-barnacle commented on Jul 17, 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.

  5. locked as resolved and limited conversation to collaborators on Sep 7, 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

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:needs-infoClawSweeper needs more reporter information before it can verify 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.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.staleMarked 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