Problem
The TUI exposes a preview of the newest user message to the agent before that message is delivered through the normal user_messages queue. Agents frequently interpret that preview as the actual queued message and respond to it immediately. When the queue subsequently pumps, the agent receives the same user message through the normal channel and answers it a second time.
This makes the message lifecycle ambiguous to the agent and results in duplicate answers, duplicated work, and confusing conversation history.
Observed behavior
- The user submits a message.
- The agent sees the message text in a TUI/turn preview or notification.
- The agent treats that preview as actionable input and responds.
- The normal user-message queue pumps and delivers the same message.
- The agent responds again.
Expected behavior
A user message should have one unambiguous delivery path and be handled exactly once. If a preview must be exposed to the agent, it should be clearly marked as non-actionable/already pending delivery, and the runtime should prevent it from being mistaken for a second message.
Possible directions
- Do not place user-message preview content in the agent context before queue delivery.
- Replace the content preview with metadata only (for example, “user message pending”).
- Give previews and queued messages a stable message ID and deduplicate handling.
- Clarify the agent/runtime contract so only messages consumed from
user_messages are actionable.
Acceptance criteria
- A newly submitted user message causes one agent handling turn, not one for the preview and another after queue delivery.
- Tests cover a user message arriving while an agent turn is active and verify exactly-once handling.
- The TUI still provides useful pending-message feedback without exposing ambiguous actionable content to the agent.
Problem
The TUI exposes a preview of the newest user message to the agent before that message is delivered through the normal
user_messagesqueue. Agents frequently interpret that preview as the actual queued message and respond to it immediately. When the queue subsequently pumps, the agent receives the same user message through the normal channel and answers it a second time.This makes the message lifecycle ambiguous to the agent and results in duplicate answers, duplicated work, and confusing conversation history.
Observed behavior
Expected behavior
A user message should have one unambiguous delivery path and be handled exactly once. If a preview must be exposed to the agent, it should be clearly marked as non-actionable/already pending delivery, and the runtime should prevent it from being mistaken for a second message.
Possible directions
user_messagesare actionable.Acceptance criteria