The fine-grained-tool-streaming opt-out is what actually fixes the
"Streaming completed but tool call never finished" crash loop: under
that beta an output cutoff mid-tool_use ends the stream without
content_block_stop, fast-agent's tool tracker leaves the block open,
and _raise_for_incomplete_anthropic_tools raises a RuntimeError that
bypasses the graceful stop_reason=max_tokens path and burns the retry
ladder. That shim costs no output length and is kept.
The companion max_tokens clamp is not. Its 20 000 ceiling was an
empirical observation, never a documented Mantle limit, and
re-investigation could not establish what enforces it: fast-agent
carries no 20 000 default anywhere (the matching TASK_BUDGET_MIN_TOKENS
is a validation floor for a different, unconfigured feature), no model
overlay is configured, and ModelDatabase reports
max_output_tokens=128000 for opus-4-8. Installing it would cement a
ceiling we cannot prove and silently truncate turns that might
otherwise complete.
install_max_tokens_clamp() is left in place, unwired, so it can be
re-enabled if the limit is ever confirmed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two new Mantle shims, auto-installed alongside the existing pair:
- Opt out of the fine-grained-tool-streaming beta. Under it, an
output-token cutoff mid-tool_use ends the stream without
content_block_stop; fast-agent raises "Streaming completed but tool
call never finished" and burns its retry ladder against the same
wall (the observed ~700s Alan revise_workspace_file failures on
Taurus).
- Clamp default maxTokens to Mantle's observed 20 000-token server
ceiling, so the model stops gracefully (proper block close +
stop_reason=max_tokens) instead of being cut off by the gateway.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>