Skip to content

fix(acp): keep agent DM replies top-level - #5661

Open
Illuminfti wants to merge 1 commit into
block:mainfrom
Illuminfti:pr/dm-flat-replies
Open

fix(acp): keep agent DM replies top-level#5661
Illuminfti wants to merge 1 commit into
block:mainfrom
Illuminfti:pr/dm-flat-replies

Conversation

@Illuminfti

@Illuminfti Illuminfti commented Aug 12, 2026

Copy link
Copy Markdown

Addresses #2748 with a deliberately different design than #2766 and #2778 — filing as an explicit alternative, not a duplicate.

The fork in #2748

Two ways to stop DM conversations nesting one level deeper per exchange:

  1. Root-anchored threading (fix(acp): anchor DM replies to thread root #2766, fix(acp): anchor DM thread replies to the thread root, not the latest message #2778): keep replies threaded, but always anchor to the conversation root instead of the latest message.
  2. Flat DMs (this PR): in a 1:1 DM, ordinary agent responses are top-level messages with no reply anchor at all.

Why flat

A DM with an agent is a conversation, not a review thread. Root-anchoring still renders every agent response as "a reply" the client tucks under an expandable thread — the human keeps clicking into threads to read what is functionally a linear chat. Flat matches how every mainstream DM surface behaves and needs no client-side rendering special-cases.

Scope is DM-only and human-facing-only:

  • channels and forums are untouched;
  • agent-to-agent subthreads inside DMs stay threaded (task structure is worth preserving when no human is reading).

Implementation: reply-destination policy in queue.rs + a matching instruction in the ACP base prompt.

Testing

  • cargo test -p buzz-acp --lib — 753 passed
  • cargo clippy -p buzz-acp --all-targets / cargo fmt --check — clean

If maintainers prefer the root-anchored design, happy to close in favor of #2766/#2778 — the value is in picking one; the nesting bug has six open PRs and none landed.

In a 1:1 DM, agents currently anchor every reply to the previous message, so each exchange nests one thread level deeper and the human has to expand a growing reply chain to follow a plain conversation (block#2748).

This changes the reply-destination policy for DMs only: ordinary agent responses in a DM are published as top-level channel messages (no reply anchor). Channel and forum behavior is unchanged, and agent-to-agent subthreads inside DMs remain threaded.

Signed-off-by: Ika Minami <ika@infiniteidol.com>
@Illuminfti
Illuminfti requested a review from a team as a code owner August 12, 2026 14:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ea2c32676

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1582 to +1583
let reply_anchor = if is_dm {
thread_tags
.root_event_id
.is_some()
.then(|| last_event.event.id.to_hex())
None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve agent-only DM subthreads

When a threaded DM event comes from a profile marked is_agent and mentions no human, this unconditional DM branch bypasses turn_is_human_facing, sets no reply destination, and adds an instruction requiring a top-level send. Consequently agent-to-agent task subthreads in DMs are flattened too, contradicting the retained agent-only threading rule in base_prompt.md; apply the flat-DM policy only to human-facing turns and keep a threaded destination for agent-only ones.

Useful? React with 👍 / 👎.

@ravarora2 ravarora2 added the triage-ready Appropriate for agentic review label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-ready Appropriate for agentic review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants