Skip to content

fix(buzz-acp): distinguish cancel-drain expiry from real hard-cap timeout#1893

Open
wpfleger96 wants to merge 1 commit into
mainfrom
duncan/cancel-drain-timeout
Open

fix(buzz-acp): distinguish cancel-drain expiry from real hard-cap timeout#1893
wpfleger96 wants to merge 1 commit into
mainfrom
duncan/cancel-drain-timeout

Conversation

@wpfleger96

Copy link
Copy Markdown
Member

The post-cancel cleanup drain in cancel_with_cleanup_grace() shared AcpError::HardTimeout with the true 1-hour max-turn deadline. The hard-cap dead-lettering policy triggered whenever the 5s drain expired after a steer/interrupt/cancel, even though the original in-flight batch should have been preserved and merged into the next turn like a normal cancel.

cancel_with_cleanup_grace() now maps its own drain-deadline expiry to a new AcpError::CancelDrainTimeout, leaving genuine absolute-deadline HardTimeout failures untouched. TimeoutKind is unchanged (still Idle/Hard only) — this is a wholly separate PromptOutcome::CancelDrainTimeout variant to avoid re-overloading the same signal.

The corresponding PromptOutcome::CancelDrainTimeout requeues the triggering batch via requeue_as_cancelled (no retry/dead-letter accounting, preserving the original CancelReason) while still respawning the agent process, since its post-cancel protocol state is unknown. The existing PromptOutcome::Timeout(TimeoutKind::Hard) dead-letter path is untouched.

@wpfleger96 wpfleger96 requested a review from a team as a code owner July 15, 2026 02:17
…eout

The post-cancel cleanup drain in cancel_with_cleanup_grace() shared
AcpError::HardTimeout with the true 1-hour max-turn deadline. PR #1844's
hard-cap policy dead-lettered the in-flight batch immediately whenever the
5s drain expired, even though it should have been preserved and merged
into the next turn like a normal cancel.

cancel_with_cleanup_grace() now maps its own drain-deadline expiry to a
new AcpError::CancelDrainTimeout, leaving genuine absolute-deadline
HardTimeout failures untouched. The corresponding PromptOutcome::
CancelDrainTimeout requeues the triggering batch via requeue_as_cancelled
(no retry/dead-letter accounting) while still respawning the agent
process, since its post-cancel protocol state is unknown.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96 wpfleger96 force-pushed the duncan/cancel-drain-timeout branch from 678b23d to f94c48f Compare July 15, 2026 02:38
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