Skip to content

DeepAgents v3 stream can stop before tool execution when tool_calls are dropped after blank text #548

Description

@yanchxx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions