fix(acp): reset the pending grace on in-progress tool-call updates; truthful expiry diagnostics - #1
Merged
Benjamin-eecs merged 1 commit intoAug 30, 2026
Conversation
…ruthful expiry diagnostics A single long tool call that streamed in-progress tool_call_update notifications past the grace boundary was killed as idle: those updates mutate ToolCallRecord in place, invisible to both the pending-set snapshot and _activity_count. The watchdog now observes a monotonic ACPSession.tool_call_update_count each poll, and any change restarts the pending grace clock alongside pending-set changes — a call that keeps talking defers as long as it talks, while one silent for the full grace still trips. On grace expiry, the raised message and IdleTimeoutDiagnostic now report the truth via additive fields: which pending calls exceeded the grace, when the pending set last changed, when the last update was observed, and how many updates were seen. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZggU3vNYzr3hfDZJUE7jX
Merged
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey Benjamin — following up on the review notes on benchflow-ai#1066: this keeps your bounded-grace design and the 3x constant exactly as-is, and only makes the grace clock restart when a pending call streams in-progress
tool_call_updates (those mutateToolCallRecordin place, so they were invisible to both the pending-set snapshot and_activity_count, and a single long call that kept reporting progress past the grace was killed as idle). The watchdog now snapshots a new monotonicACPSession.tool_call_update_countalongside your pending-set tuple — a call that keeps talking defers as long as it talks, while one that stays silent for the full grace still trips, so your lost-completion test passes unmodified. On grace expiry the message andIdleTimeoutDiagnosticnow say what actually happened (which calls exceeded the grace, when the pending set last changed, when the last update arrived, how many updates were seen) via additive fields, keeping the diagnostic shape andclassify_errorbehavior backward compatible.Red→green: the two new tests fail on your branch as-is (the streaming-call false kill, and the untruthful expiry message) and pass with this patch; your own tests are untouched and green (
tests/test_acp.py99 passed).ruff/ format /tyclean.Merging this into your branch makes it part of benchflow-ai#1066 — and feel free to close it and implement your own version instead; the review stands either way.