Repository navigation
Treat input_json_delta as a known non-text block (log flood) - #541
Merged
Merged
Conversation
Closes #540. Anthropic streams a tool call's arguments as input_json_delta blocks; only tool_use was known, so every chunk of every tool call logged an 'unrecognized content block type' warning (26,389 in four days in production). The new test fails without the change and passes with it; a genuinely unknown block type still warns once per call. Full offline suite: 3279 passed.
This was referenced Sep 29, 2026
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.
Closes #540.
The problem
classify_content_blocks_with_indicesonly whitelistedtool_useas a known non-text block. Anthropic streams a tool call's arguments asinput_json_deltablocks, one per chunk (hundreds for a long code call), so every chunk of every tool call loggedclassify_content_blocks: unrecognized content block type 'input_json_delta'.Measured on the server: 26,389 of these warnings in production over 4 days (all
input_json_delta), 0 on dev, which was recreated today. It buries real warnings, and the log-shipping cost grows with tool use.The fix
input_json_deltajoinstool_usein_KNOWN_NON_TEXT_BLOCK_TYPES: it carries the call's JSON arguments, never answer text, so dropping it quietly is correct. A block type that is really unknown still warns once per call (the existing tests for that pass unchanged).Testing
A new test feeds the real streamed shape (a
tool_useblock, theninput_json_deltachunks with partial JSON, then a text block next to an empty delta) and asserts nothing is surfaced but the text and nothing is logged. It fails without the change and passes with it. Full offline suite in a clean worktree: 3,279 passed. Found by the agent that built the activity-status labels (#538), which saw 62 of these warnings for one streamed code call in a test.