Skip to content

Agents should reply to the exact message that triggered them #4072

Description

@Lordymine

Motivation

When a user is already talking with an agent inside a thread, the agent should make it clear which message it is answering. Today, the response can point to the thread root instead of the exact triggering message, which makes conversations with multiple messages difficult to follow and makes the agent feel less proactive.

Proposed solution

For human-facing agent turns:

  • Reply to the exact message that triggered the agent turn.
  • Preserve the author mention for that parent message.
  • Keep top-level replies anchored to the triggering message, which becomes the new thread root.
  • Preserve the existing agent-to-agent behavior so coordination turns are not unnecessarily flattened.

Add regression tests covering nested human replies, top-level messages, agent-only mentions, and agent-to-agent turns.

Alternatives considered

Keep anchoring every human-facing reply to the thread root. This keeps threads flat, but loses the direct relationship between the agent response and the specific message being answered.

Additional context

This behavior was observed while using Buzz Desktop. The existing message UI already supports rendering direct replies; the change is to make the agent harness consistently target the triggering event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions