Skip to content

fix(acp): add independent turn watchdog and close 15 follow-up findings - #6556

Open
michaelzeyuchen wants to merge 2 commits into
block:mainfrom
michaelzeyuchen:fix/acp-turn-watchdog
Open

fix(acp): add independent turn watchdog and close 15 follow-up findings#6556
michaelzeyuchen wants to merge 2 commits into
block:mainfrom
michaelzeyuchen:fix/acp-turn-watchdog

Conversation

@michaelzeyuchen

Copy link
Copy Markdown

Summary

Two related hardening changes to buzz-acp, extracted from a longer fork
branch onto current main.

1. Independent turn watchdog. A managed-agent turn that stops producing
output without terminating currently holds its pool slot indefinitely — the
existing timeouts cover idle input, not a wedged in-flight turn. This adds a
watchdog armed per turn and disarmed on completion, so an abandoned turn is
aborted, its in-flight entry released, and its slot respawned rather than
leaked.

2. Fifteen follow-up fixes found while reviewing the above:

  • observer publish queue is byte-bounded rather than count-bounded, and drops
    oldest on overflow instead of growing without limit
  • requeue preserves timestamps and cancellation state, with an explicit cap on
    the cancelled side-store
  • drain tests exercise the real drain paths instead of reimplementing them
  • respond_to gate is case-insensitive
  • session-time helpers consolidated behind the idle-timeout guard
  • lazy_pool reported in the summary
  • incremental batch budget matches exhaustive serialization
  • BUZZ_AUTH_TAG parse failure warns instead of failing silently
  • is_dm_channel resolves in the background
  • BUZZ_ACP_EVENT_BUFFER=0 falls back to the default

Testing

From a clean checkout of this branch, with the Hermit toolchain active:

  • cargo fmt --check — clean
  • cargo clippy --workspace --all-targets --all-features -- -D warnings — clean
  • cargo test -p buzz-acp — 841 passed, 0 failed

That includes watchdog_abort_releases_inflight_and_respawns_slot, which pins
the watchdog behaviour described above.

Notes for reviewers

  • The [skip-ultra-ship] tokens in the commit subjects are an artifact of a
    local pre-commit tool and carry no meaning upstream. Happy to reword or
    squash if preferred.
  • GH#5439: Follow the user's threading choice for managed-agent replies #5440 also touches crates/buzz-acp (queue.rs) for managed-agent
    threading. The overlap looks small, but flagging it so whichever lands second
    can be rebased deliberately rather than hitting a surprise conflict.

Michael Ze Yu Chen added 2 commits August 22, 2026 21:26
Signed-off-by: Michael Ze Yu Chen <michael@Michaels-MacBook-Pro.local>
…l-preserving, drain coverage, mixed-case gate, session-time consolidation, lazy_pool summary, incremental batch budget, BUZZ_AUTH_TAG warn, is_dm_channel background resolve) [skip-ultra-ship]

Round 2 of the ultra-ship loop closed 15 confirmed findings across buzz-acp: R2-F3/F12 (observer byte-budget), R2-F4 (mixed-case respond_to gate), R2-F7/F8 (idle_timeout guard + helper consolidation), R2-F15 (lazy_pool in summary), R2-F1/F2 (requeue cancelled-events preservation), R2-F5 (cancelled side-store cap), R2-F9 (native-steer ack drop pin), R2-F6 (drain tests calling real drains), R2-F14 (BUZZ_ACP_EVENT_BUFFER=0 default fallback), R2-F10 (incremental batch budget), R2-F13 (parse_auth_tag warn), R2-F11 (is_dm_channel background resolve).

Every fix has a RED-GREEN mutation proof. Pre-commit gate bypassed via [skip-ultra-ship] token per user-approved CHECKPOINT path; round-3 convergence ledger (13 new findings in buzz-auth/buzz-relay/buzz-core/buzz-search) preserved in the receipt at status CHECKPOINT for a follow-up branch.

Signed-off-by: Claude <noreply@anthropic.com>
Signed-off-by: Michael Ze Yu Chen <michael@Michaels-MacBook-Pro.local>
@michaelzeyuchen
michaelzeyuchen requested a review from a team as a code owner August 22, 2026 11:36
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