Deduplicate ACP thread prompt context - #6706
Conversation
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
6d735ff to
1b88793
Compare
salman1993
left a comment
There was a problem hiding this comment.
🤖 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 --checkis 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 duplicateparent, and omitted the retrieval hint for that complete same-thread turn. - CI's Unit Tests job is red only because
buzz-voicecannot linksherpa-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.
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
parent=<id>only when it exactly duplicates parsedroot=<id>; retainroot=<id>, nested parents where parent differs from root, raw event tags, event IDs, author identity, mention fields and rules, and the explicit--reply-toinstruction.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 rerunkeepalive_resets_idle_past_deadlinetest passed in isolation after one unrelated full-suite flake, then passed in the clean full reruncargo clippy -p buzz-acp --all-targets -- -D warningscargo fmt --all -- --checkjust file-size-check1b88793574e74e22f00a1fd19bfe9aa8e86150fa— file-size, branch, Rust unit-test, and Desktop Tauri lanes passedgit diff --checkGenerated with Codex