Skip to content

[BUG] Bedrock streaming tool calls receive empty arguments ({}) — accumulated input is never folded back at contentBlockStop #7243

Description

@kimnamu

Description

Streaming tool calls through the native Bedrock provider hand the tool empty arguments ({}). Non-streaming works.

contentBlockDelta accumulates the tool input JSON fragments, but at contentBlockStop the accumulated string is never parsed back into the tool-call payload, so the call is emitted with empty arguments. Both the sync and async streaming handlers are affected. The non-streaming path already folds the arguments back, which is why only stream=True breaks.

Reproduced on current main (92eb5f91 merged into the branch under test):

# streaming, before fix
assert {} == {'city': 'Paris'}
# same input, non-streaming
{'city': 'Paris'}

Steps to Reproduce

  1. Configure an LLM with a Bedrock model (bedrock/anthropic.claude-...) and stream=True.
  2. Give the agent a tool that takes an argument, e.g. a weather tool with city.
  3. Ask a question that triggers the tool.
  4. The tool receives {}; with stream=False it receives {'city': 'Paris'}.

Expected behavior

Streaming tool calls carry the same arguments as non-streaming ones.

Context

This re-files #6149, which the stale bot auto-closed on 2026-07-20 while PR #6150 (approved 2026-06-23) was still waiting to be merged. With the issue closed, the first-time-contributor check auto-closed the PR today, so the fix had no open issue to attach to. Filing this so the approved PR can be reopened against an open issue. Same root cause family as #4972 / #5415, but on the streaming path.

Existing PRs for this bug (three, all stalled)

PR Author Opened State Notes
#5739 Ghraven 2026-05-07 open, no-pr-activity earliest; same fold-back, no tests
#6151 devin-ai-integration 2026-06-13 open, no-pr-activity same fold-back, size/L
#6150 kimnamu 2026-06-13 approved 06-23, auto-closed today fold-back + 3 regression tests (sync/async); re-verified on main before this filing

They all patch the same two handlers, so only one is needed. #5739 came first; #6150 is the one that carries regression tests and a maintainer approval. Happy to defer to whichever you prefer — if it's not mine, feel free to close #6150 for good.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions