langchain-ai
langchain
BlogDocsChangelog

fix(anthropic): handle pre-completed content in message_start events

#34408
Comparing
majiayu000:fix-anthropic-empty-aimessage-streaming
(
50dc89f
) with
master
(
d3e9c4d
)
CodSpeed Performance Gauge
0%
Untouched
3
Skipped
31

Benchmarks

Skipped (31)

Passed

test_init_time_with_client
libs/partners/anthropic/tests/unit_tests/test_standard.py
CodSpeed Performance Gauge
0%
2.3 ms*2.3 ms
test_stream_time
libs/partners/anthropic/tests/integration_tests/test_standard.py::TestAnthropicStandard
CodSpeed Performance Gauge
0%
34.8 ms*34.7 ms
test_init_time
libs/partners/anthropic/tests/unit_tests/test_standard.py::TestAnthropicStandard
CodSpeed Performance Gauge
0%
795.6 µs*796.6 µs

Commits

Click on a commit to change the comparison range
Base
master
d3e9c4d
+0.13%
fix(anthropic): handle pre-completed content blocks in message_start events When using programmatic tool calling (e.g., code_execution_20250825), Anthropic's API returns pre-completed tool_use blocks directly in the message_start event instead of streaming them incrementally. This caused empty AIMessage responses when using astream(). This fix modifies _make_message_chunk_from_anthropic_event() to check for and process pre-completed content blocks in message_start events, ensuring tool_use blocks are properly extracted into tool_call_chunks. Closes #34406
bd5fa46
3 days ago
by majiayu000
+0.05%
fix: resolve lint and type check errors in tests
91a15fd
3 days ago
by majiayu000
-0.13%
chore: update uv.lock
db9ee19
2 days ago
by majiayu000
-0.03%
Merge branch 'master' into fix-anthropic-empty-aimessage-streaming
bb59b1a
21 hours ago
by mdrxy
+0.13%
Merge branch 'master' into fix-anthropic-empty-aimessage-streaming
50dc89f
19 hours ago
by majiayu000
© 2025 CodSpeed Technology
Home Terms Privacy Docs