Skip to content

Agent sends duplicate message #20699

@ColaHikari

Description

@ColaHikari

Description

When a user sends a simple message like "hello!", the agent generates two assistant responses instead of one:

Message 1 (hidden from user, but visible to agent): Contains the greeting text
Message 2 (shown to user): Has empty visible text, but its reasoning part says "I've already sent my response greeting them and asking what they need help with"
Both messages have the same parentID (replying to the same user message).

The user can only see Message 2, which makes the agent appear confused — its visible response is empty, and the reasoning references content from a message the user never saw.

In more complex queries (e.g., "Write a sorting algorithm"), the actual code or explanation in Message 1 is completely dropped. The user only sees a reasoning block saying:

"The user asked a direct question and I answered it clearly. The task is complete."

This results in a total failure of the agent's primary function, as the user receives no content despite the model believing it has fulfilled the request.

Expected Behavior
The reasoning and visible text should be consistent and directly address the user's prompt.

Actual Behavior
Message 1’s response is discarded or hidden, and Message 2 is generated as a "phantom" retry that lacks substance but inherits the "thought" process from the first attempt.

Plugins

None

OpenCode version

v1.3.12

Steps to reproduce

OpenCode is deployed on a Linux system. Accessing OpenCode via web on Windows leads to the aforementioned issues, but there are no such problems when using macOS.
Additionally, there is an assistant message located above the user's message and it is invisible—an extremely peculiar issue.

  1. User sends "hello!" or any simple greeting
  2. Observe: Two assistant messages are generated with the same parentID
  3. First message (hidden from UI): Contains visible greeting text
  4. Second message (shown to UI): Empty visible text, but reasoning references the first message's content

Screenshot and/or share link

Image Image

messages.txt

Operating System

windows 11

Terminal

No response

Metadata

Metadata

Assignees

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