Skip to content

acp: explain output-length continuation exhaustion instead of naming it (#1893) - #1894

Merged
justrach merged 1 commit into
mainfrom
fix/acp-output-length-explanation
Nov 12, 2026
Merged

justrach merged 1 commit into
mainfrom
fix/acp-output-length-explanation

Conversation

@justrach

Copy link
Copy Markdown
Owner

Fixes #1893.

A turn that exhausts the output-length continuation allowance ended with session/prompt: OutputLengthExceeded (code -32603). The explanation existed but was never read: v0.302.74.64:src/agent_length.zig:10-12 records the recovery text immediately before returning the error, while v0.302.74.64:src/acp_live_turn.zig:333-337 special-cases only EmptyCompletion and otherwise falls through to @errorName(err).

Add the matching OutputLengthExceeded arm, reusing the existing explanation in the same shape as the EmptyCompletion arm from #1802. No new wording, and no change to the continuation cap, retry policy or partial history: an intentional bounded stop is now described as one, rather than as an opaque internal failure.

Coverage: a describeError test asserting the explanation is returned instead of the error name; it fails when the arm is removed. Full suite green (3878 passed; 6 skipped; 0 failed), tier 1 fmt/reach/sdk green.

…it (#1893)

The bounded output-length allowance (#1646) ends a turn with
error.OutputLengthExceeded once its four continuations are spent. Every
surface explained that except ACP: agent_length.afterStep calls sayApiError
with exhausted_message ("work is partial and has been preserved. Send a new
message or resume to continue") just before returning the error, and the line
REPL and one-shot path print it — but `root.out` is null inside an ACP session,
so that sentence went to stderr and the JSON-RPC reply carried only
`{"code":-32603,"message":"OutputLengthExceeded"}`.

describeError already had the cure for the identical EmptyCompletion loss
(#1802): describe the failure in words the user can act on. Route
OutputLengthExceeded through the same arm, reusing agent_length.exhausted_message.
No new wording, and nothing about the turn changes: the continuation cap, the
retry ladder, and the retained partial history are untouched — only the
description the client is handed.

Test asserts the description is the explanation (with or without a parked
last_api_error) and never @Errorname; it fails if the arm is removed.

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
@justrach
justrach merged commit cbeccc7 into main Nov 12, 2026
7 of 8 checks passed
@justrach
justrach deleted the fix/acp-output-length-explanation branch November 12, 2026 15:22
justrach added a commit that referenced this pull request Nov 12, 2026
…n, detached cold catalog) and ACP output-length explanation (#1893)

Release notes and what's-new text for v0.302.74.65, and bump
test_count_baseline to 3945: the startup stack (#1896) grew the suite
from 3927 to 3944 and the #1893 fix (#1894) added one more; measured on
the merged main (cbeccc7) with scripts/eval/tier1_test_binary.py scan,
suite green via zig build test.

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
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.

ACP exposes output-length continuation exhaustion as an opaque internal error

1 participant