Skip to content

[Bug] Exec completion events injected into user chat session as queued messages, derailing active conversation #61990

@jacobaross

Description

@jacobaross

Problem

When a session is processing a long-running exec task (e.g. browser automation for a Whole Foods grocery order via Camoufox), internal exec completion events are delivered as [Queued messages while agent was busy] into the same chat session. The model treats these as new user input, abandoning the active task mid-flow and responding to machine-generated noise instead of continuing the workflow.

Reproduction

  1. Trigger a workflow involving multiple sequential exec + process poll calls (e.g. grocery order via browser automation — grocery search, grocery add, grocery cart, etc.)
  2. While the session is processing, the user sends a reply (normal: answering a question the agent asked mid-flow)
  3. The agent continues the workflow, generating more exec completions
  4. When the model finishes a tool loop, it receives the exec completion dumps in the [Queued messages while agent was busy] block as if they were user messages
  5. Model context shifts — it abandons the workflow and starts responding to the internal System: Exec completed ... events

Expected

Exec completion events should land as tool results in the session context — not as queued user messages. Internal system events should never appear in the [Queued messages while agent was busy] block alongside real user chat.

Actual

The queued messages block contains entries like:

System: [2026-04-06 11:04:45 EDT] Exec completed (gentle-g, code 0) :: 42k/272k (15%) ...
System: [2026-04-06 11:05:43 EDT] Exec failed (grand-la, signal SIGKILL)
System: [2026-04-06 11:09:20 EDT] Exec completed (lucky-ca, code 0) :: [grocery search results JSON] ...

The model receives all of these as user input on the next turn, causing context corruption.

Real-world impact

  • User said "grocery run," agent asked one clarifying question, user answered, agent continued
  • Underlying grocery order did complete (credit card charged, items ordered) — but agent never sent a completion message
  • User had no idea the order placed until the delivery notification
  • Agent session ended in a confused state responding to exec output instead of the workflow

Environment

  • OpenClaw: 2026.4.5
  • Model: openai-codex/gpt-5.4 (codex alias)
  • Channel: Discord group channel (requireMention: false)
  • Task: long-running browser automation (Camoufox + Python scripts, 10+ sequential exec calls over ~12 minutes)

Workaround

Use message tool explicitly for all user-visible updates during long exec chains, rather than relying on chat reply. Reduces blast radius but doesn't prevent context corruption.

Related

Notes

This may be model-specific — we only started seeing it after upgrading to GPT-5.4 (codex), though the upgrade coincided with OpenClaw 2026.4.5. Unclear whether it's a model behavior change or a platform routing change in 4.5.

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