buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Agents should reply to the exact message that triggered them

Open Lordymine opened this issue 4 months ago • 2 comments

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.

Lordymine avatar Aug 01 '26 07:08 Lordymine

Fix up in PR #4092 (branch claude/issue4072-trigger-anchor-20260801).

Human-facing thread replies now anchor to triggering_event_id (the exact message that triggered the turn) instead of flattening to the thread root — matching the behavior DM turns already had. Top-level human mentions still anchor to the triggering event (unchanged); agent↔agent turns still get no forced anchor, preserving deep-nesting coordination.

Substantive test coverage as the issue requested:

  • inverted the old root-anchoring regression test to assert anchor=triggering event and NOT root, NOT intermediate parent;
  • added a dedicated nested-depth (root≠parent) unit regression test;
  • updated the channel-thread, batched-thread, cross-thread-steer, and DM-mirror integration tests to match;
  • kept the "explicit root-post" escape-hatch text assertion untouched (the hints still tell agents they may honor it).

Verification: cargo test -p buzz-acp --lib 663/663 green, cargo clippy --all-targets -- -D warnings clean.

iroiro147 avatar Aug 01 '26 10:08 iroiro147

@iroiro147 I opened a PR before to fix this https://github.com/block/buzz/issues/4072

Lordymine avatar Aug 01 '26 14:08 Lordymine