Skip to content

Treat input_json_delta as a known non-text block (log flood) - #541

Merged
neuromechanist merged 2 commits into
developfrom
feature/issue-540-input-json-delta
Sep 29, 2026
Merged

neuromechanist merged 2 commits into
developfrom
feature/issue-540-input-json-delta

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #540.

The problem

classify_content_blocks_with_indices only whitelisted tool_use as a known non-text block. Anthropic streams a tool call's arguments as input_json_delta blocks, one per chunk (hundreds for a long code call), so every chunk of every tool call logged classify_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_delta joins tool_use in _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_use block, then input_json_delta chunks 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.

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.
@neuromechanist
neuromechanist merged commit 62ef67c into develop Sep 29, 2026
7 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-540-input-json-delta branch September 29, 2026 15:44
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.

1 participant