[GH-ISSUE #548] DeepAgents v3 stream can stop before tool execution when tool_calls are dropped after blank text #274

Open
opened 2026-06-05 17:21:24 -04:00 by yindo · 0 comments
Owner

Originally created by @yanchxx on GitHub (May 20, 2026).
Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/548

Summary

While validating DeepAgents 1.10.2 with LangGraph v3 events, we found a blocker where a run can stop before executing tools if the model emits a blank text block immediately before a tool call.

The likely root cause is in @langchain/core stream content-block assembly, so I opened the detailed core report here:

I'm opening this issue here because the user-visible failure appears in DeepAgents runs: the agent produces a tool intent, but the tools node never executes.

Tested stack

deepagents: 1.10.2
@langchain/core: 1.1.47
@langchain/openai: 1.4.6
@langchain/langgraph-sdk: 1.9.4
@langchain/react: 1.0.4
langchain: 1.4.1

Model/provider:

  • OpenAI-compatible chat model
  • The model can emit valid tool calls
  • Direct ChatOpenAI.bindTools().invoke() works
  • Direct ChatOpenAI.stream() aggregation works

DeepAgents failure mode

Using createDeepAgent(...).streamEvents(..., { version: "v3" }), the event stream produced this shape:

content-block-delta index=0 text="\n\n"
content-block-delta index=0 block-delta type=tool_call_chunk id=... name=ls args=...
content-block-finish index=0 content={ type: "text", text: "\n\n", id, name: "ls", args: "{\"path\":\"/\"}" }

The resulting checkpoint / values AI message had:

content=[{ type: "text", text: "\n\n", id, name, args }]
tool_calls=[]

Since tool_calls was empty, the DeepAgents graph did not execute the tool node. In the app this looked like the agent paused/stopped after one model step.

Why this matters for DeepAgents adoption

For apps trying to use the official DeepAgents/LangGraph v3 event path, this breaks a very common flow:

  1. model decides to call a tool,
  2. stream shows a tool-call-like delta,
  3. final checkpoint drops tool_calls,
  4. tool execution never happens,
  5. live UI state and refreshed checkpoint state diverge.

Local workaround verified

A local patch-package patch against @langchain/core@1.1.47 made the same DeepAgents run continue:

  • Treat a blank text block followed by tool_call_chunk on the same index as a tool-call block.
  • Normalize malformed blank text blocks that contain id/name/args into tool_call_chunk before final content-block standardization.

After that patch, the same DeepAgents run emitted tool-started / tool-finished and the checkpoint contained the expected tool-call behavior.

Ask

It would be helpful for DeepAgents to either:

  • track/follow the core fix in langchainjs#10937, or
  • add a regression test around streamEvents(..., { version: "v3" }) where an OpenAI-compatible model emits leading blank text before a tool call, ensuring the tools node still executes.
Originally created by @yanchxx on GitHub (May 20, 2026). Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/548 ### Summary While validating DeepAgents `1.10.2` with LangGraph v3 events, we found a blocker where a run can stop before executing tools if the model emits a blank text block immediately before a tool call. The likely root cause is in `@langchain/core` stream content-block assembly, so I opened the detailed core report here: - https://github.com/langchain-ai/langchainjs/issues/10937 I'm opening this issue here because the user-visible failure appears in DeepAgents runs: the agent produces a tool intent, but the tools node never executes. ### Tested stack ```text deepagents: 1.10.2 @langchain/core: 1.1.47 @langchain/openai: 1.4.6 @langchain/langgraph-sdk: 1.9.4 @langchain/react: 1.0.4 langchain: 1.4.1 ``` Model/provider: - OpenAI-compatible chat model - The model can emit valid tool calls - Direct `ChatOpenAI.bindTools().invoke()` works - Direct `ChatOpenAI.stream()` aggregation works ### DeepAgents failure mode Using `createDeepAgent(...).streamEvents(..., { version: "v3" })`, the event stream produced this shape: ```text content-block-delta index=0 text="\n\n" content-block-delta index=0 block-delta type=tool_call_chunk id=... name=ls args=... content-block-finish index=0 content={ type: "text", text: "\n\n", id, name: "ls", args: "{\"path\":\"/\"}" } ``` The resulting checkpoint / values AI message had: ```text content=[{ type: "text", text: "\n\n", id, name, args }] tool_calls=[] ``` Since `tool_calls` was empty, the DeepAgents graph did not execute the tool node. In the app this looked like the agent paused/stopped after one model step. ### Why this matters for DeepAgents adoption For apps trying to use the official DeepAgents/LangGraph v3 event path, this breaks a very common flow: 1. model decides to call a tool, 2. stream shows a tool-call-like delta, 3. final checkpoint drops `tool_calls`, 4. tool execution never happens, 5. live UI state and refreshed checkpoint state diverge. ### Local workaround verified A local `patch-package` patch against `@langchain/core@1.1.47` made the same DeepAgents run continue: - Treat a blank text block followed by `tool_call_chunk` on the same index as a tool-call block. - Normalize malformed blank text blocks that contain `id/name/args` into `tool_call_chunk` before final content-block standardization. After that patch, the same DeepAgents run emitted `tool-started` / `tool-finished` and the checkpoint contained the expected tool-call behavior. ### Ask It would be helpful for DeepAgents to either: - track/follow the core fix in `langchainjs#10937`, or - add a regression test around `streamEvents(..., { version: "v3" })` where an OpenAI-compatible model emits leading blank text before a tool call, ensuring the tools node still executes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#274