Skip to content

Deduplicate ACP thread prompt context - #6706

Draft
salman1993 wants to merge 1 commit into
mainfrom
smohammed/acp-prompt-dedup
Draft

Deduplicate ACP thread prompt context#6706
salman1993 wants to merge 1 commit into
mainfrom
smohammed/acp-prompt-dedup

Conversation

@salman1993

@salman1993 salman1993 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Why

This is a small isolated follow-up to #6503: remove two proven duplicate prompt fragments without adopting its broader framing experiment or changing Buzz-native routing and identity behavior.

What

  • Remove parsed parent=<id> only when it exactly duplicates parsed root=<id>; retain root=<id>, nested parents where parent differs from root, raw event tags, event IDs, author identity, mention fields and rules, and the explicit --reply-to instruction.
  • Remove the full-history retrieval hint only when complete, untruncated conversation or thread context is included. Thread context must include its root and cover every event rendered in the batch; mixed-thread batches and root-missing windows retain retrieval guidance. Context that is absent, previously delivered, or truncated also retains retrieval guidance, and the context header, count, and messages remain unchanged.

Risk Assessment

Low — the change is confined to Buzz ACP prompt rendering and preserves all routing, identity, event, and retrieval information outside the two exact duplicate cases.

Testing

  • cargo test -p buzz-acp — 804 unit tests and 9 lifecycle integration tests passed on the clean rerun
  • Focused mixed-thread, same-thread, and missing-root prompt regressions passed
  • The timing-sensitive keepalive_resets_idle_past_deadline test passed in isolation after one unrelated full-suite flake, then passed in the clean full rerun
  • cargo clippy -p buzz-acp --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • just file-size-check
  • Repository pre-push gate at 1b88793574e74e22f00a1fd19bfe9aa8e86150fa — file-size, branch, Rust unit-test, and Desktop Tauri lanes passed
  • git diff --check

Generated with Codex

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 force-pushed the smohammed/acp-prompt-dedup branch from 6d735ff to 1b88793 Compare August 24, 2026 20:53

@salman1993 salman1993 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Re-review at exact head 1b88793574e74e22f00a1fd19bfe9aa8e86150fa: approved — no actionable findings.

The prior mixed-thread and missing-root blockers are fixed. The retrieval hint is now omitted only when the fetched window is untruncated, includes the thread root where applicable, covers every rendered batch/cancelled event, and contains no previously delivered events. Mixed-thread, reply-only, truncated, absent, and delivery-delta cases keep the escape hatch. parent is removed only when it equals root; nested parents, raw tags, event IDs, identity/mentions, and reply routing remain.

Validation:

  • Independently verified by FastValidator: full cargo test -p buzz-acp (804 unit + 9 lifecycle passed), clippy, and fmt at this SHA.
  • Independently rechecked here: the four focused regressions pass; git diff --check is clean.
  • Live-local pass against a fresh database and relay built at this SHA: a real thread root + prior reply + live reply reached a scripted ACP through session/prompt; the prompt retained root/history/raw tags/routing, omitted duplicate parent, and omitted the retrieval hint for that complete same-thread turn.
  • CI's Unit Tests job is red only because buzz-voice cannot link sherpa-onnx-c-api; the same failure is present on a later unrelated main run (32783072355). All other PR checks are green.

Product fit: this remains the narrow deletion-oriented follow-up to closed #6503 and aligns with VISION_AGENT.md's minimal/auditable boundary without adopting the broader envelope framing.

Quality bar: minimalness 9/10, elegance 9/10, correctness 9/10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant