Skip to content

fix(core): treat empty tool chunk ids as missing in merge#35414

Merged
ccurme (ccurme) merged 6 commits intolangchain-ai:masterfrom
T1mn:fix/core-tool-call-chunk-empty-id-merge
Feb 24, 2026
Merged

fix(core): treat empty tool chunk ids as missing in merge#35414
ccurme (ccurme) merged 6 commits intolangchain-ai:masterfrom
T1mn:fix/core-tool-call-chunk-empty-id-merge

Conversation

@T1mn
Copy link
Copy Markdown
Contributor

Fixes #35395

Tool call chunk aggregation treated id="" as a conflicting identifier, which prevented chunks with the same index from merging and could break streamed tool-argument reconstruction. This change treats empty ids as missing ids during list merge so chunks continue to merge correctly.

How did you verify your code works?

  • uv run --project libs/core --group test pytest libs/core/tests/unit_tests/test_messages.py::test_message_chunks
  • uv run --project libs/core --group test pytest libs/core/tests/unit_tests/test_messages.py

Breaking changes

  • None

Depends on

  • None

@github-actions github-actions bot added core `langchain-core` package issues & PRs external fix For PRs that implement a fix labels Feb 24, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 24, 2026

Merging this PR will degrade performance by 22.46%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

❌ 13 regressed benchmarks
⏩ 23 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_import_time[CallbackManager] 286.4 ms 325.5 ms -12.01%
WallTime test_import_time[LangChainTracer] 410.6 ms 464.9 ms -11.67%
WallTime test_import_time[InMemoryRateLimiter] 158.6 ms 178.1 ms -10.95%
WallTime test_import_time[InMemoryVectorStore] 552.5 ms 623.6 ms -11.4%
WallTime test_import_time[Runnable] 444.5 ms 504.4 ms -11.87%
WallTime test_import_time[HumanMessage] 239.3 ms 269.5 ms -11.19%
WallTime test_import_time[ChatPromptTemplate] 549.8 ms 648.3 ms -15.2%
WallTime test_import_time[tool] 473.5 ms 559.6 ms -15.39%
WallTime test_import_time[Document] 172.1 ms 192.3 ms -10.47%
WallTime test_import_time[PydanticOutputParser] 477.6 ms 553.7 ms -13.74%
WallTime test_async_callbacks_in_sync 18.4 ms 23.7 ms -22.46%
WallTime test_import_time[RunnableLambda] 442 ms 501.5 ms -11.86%
WallTime test_import_time[BaseChatModel] 482.7 ms 547.5 ms -11.83%

Comparing T1mn:fix/core-tool-call-chunk-empty-id-merge (d5eb8ff) with master (4ffb584)

Open in CodSpeed

Footnotes

  1. 23 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ccurme ccurme (ccurme) merged commit 7867853 into langchain-ai:master Feb 24, 2026
87 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core `langchain-core` package issues & PRs external fix For PRs that implement a fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

langchain-core 1.2.14 stream_mode == "messages" tool args parse failed

3 participants