Skip to content

message_tool_only: withheld finals stay in the agent's context as normal turns, desynchronizing agent memory from what the user saw #100368

Description

@gorkem2020

Summary

When OpenClaw withholds a plain assistant final on a message_tool_only lane, the withheld text still lands in the agent's transcript as a normal assistant turn. The agent's model of the conversation now contains content the user never received: the agent believes it said something, the user never saw it, and every later user message gets interpreted against that phantom exchange.

Observed behavior (production multi-agent install, Slack channel lane, 2026-07-04)

  1. Over several turns, the agent produced plain finals proposing and then announcing a piece of work. Each final was withheld by the runtime (correct per the lane's message_tool_only contract), so none of it reached the channel.
  2. In a later turn the agent confidently told the user "you asked for the HTML page and approved it". No such request or approval existed on the user's side; the agent was referencing its own withheld turns.
  3. The agent itself later diagnosed the mismatch by grepping its transcript: the "approval" it remembered was its own undelivered proposal.

The failure compounds: once one phantom turn is in context, subsequent replies build on it, and the user experiences an agent inventing history.

Why this is a runtime gap and not a model bug

The runtime is the only party that knows delivery status. From the transcript alone, a delivered final and a withheld final look identical to the model. No amount of prompting can recover information that is not represented in its context.

Suggested fix direction

When a final is withheld, make delivery reality visible in the agent-facing context. Options, cheapest first:

  1. Annotate the withheld turn in the transcript the model sees, for example a system marker immediately after it: "The preceding reply was NOT delivered to the user." The text stays available (it may contain useful working state) but can no longer masquerade as something the user read.
  2. Alternatively, replace the withheld final in the model-facing context with a short system notice and keep the full text only in storage.

Either way the invariant becomes: the agent's context reflects what the user actually received.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions