release: 0.16.6 — no-argument tools were uncallable on Anthropic - #153
Merged
Conversation
A tool whose schema takes no arguments has no JSON to stream, and
Anthropic still emits an input_json_delta carrying "".
serde_json::from_str("") fails with "EOF while parsing a value", so the
__partial_json sentinel survived content_block_stop and the post-stream
sweep failed the whole turn with "tool call(s) with unusable arguments,
not executed". Every no-argument tool was affected.
An empty accumulator is an empty argument object, not malformed input.
The decision is extracted into resolve_tool_arguments so it has a
regression test; truncated JSON still fails, which is the case the
sentinel exists for.
Forward-ported from the 0.18.0 line, where a live smoke harness found it.
MockProvider never streams SSE, so nothing in the suite exercised the
tool-call accumulator.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Forward-port of the fix from the 0.18.0 line, plus the patch bump.
The bug
A tool whose schema takes no arguments has no JSON to stream, but Anthropic still emits an
input_json_deltacarrying"".serde_json::from_str("")fails with "EOF while parsing a value", so the__partial_jsonsentinel survivedcontent_block_stopand the post-stream sweep failed the whole turn:Every
get_status/list_files/read_log-shaped tool is affected. Verified present on this line — thefrom_str(&partial)call site here is byte-identical to the one on main before the fix.An empty accumulator is an empty argument object, not malformed input. The decision is now
resolve_tool_arguments, a pure function with a regression test; genuinely truncated JSON still fails, which is what the sentinel exists for.How it was found
A live smoke harness on the 0.18 line, not the test suite.
MockProvidernever streams SSE, so nothing in either line's tests exercised the tool-call accumulator at all — which is why it survived here through five patch releases.Scope
Deliberately minimal. This line's
claude_sonnet_5still carries the stale $3/$15 rates; leaving that alone per instruction.Tests and clippy green on this branch. Tagging follows the maintenance-line convention — from
release/0.16.x, not main.🤖 Generated with Claude Code