Compare commits

...
Author SHA1 Message Date
Eugene YurtsevandGitHub 20558f62e2 fix(prebuilt): default ToolRuntime tools to empty list (#7651)
Backports the ToolRuntime fix onto the release branch and bumps to .
This makes default to an empty list when not provided and includes a
focused regression test, with the prebuilt lockfile updated to match the
version bump.

Created with [Deep Agents
CLI](https://docs.langchain.com/oss/python/deepagents/cli/overview)
using gpt-5.4 (provider: openai).
2026-04-30 01:41:06 +00:00
6 changed files with 19 additions and 6 deletions
+1 -1
View File
@@ -1742,7 +1742,7 @@ test = [
[[package]] [[package]]
name = "langgraph-prebuilt" name = "langgraph-prebuilt"
version = "1.0.12" version = "1.0.13"
source = { editable = "../prebuilt" } source = { editable = "../prebuilt" }
dependencies = [ dependencies = [
{ name = "langchain-core" }, { name = "langchain-core" },
@@ -44,7 +44,7 @@ import inspect
import json import json
from collections.abc import Awaitable, Callable from collections.abc import Awaitable, Callable
from copy import copy, deepcopy from copy import copy, deepcopy
from dataclasses import dataclass, replace from dataclasses import dataclass, field, replace
from types import UnionType from types import UnionType
from typing import ( from typing import (
TYPE_CHECKING, TYPE_CHECKING,
@@ -1722,9 +1722,9 @@ class ToolRuntime(_DirectlyInjectedToolArg, Generic[ContextT, StateT]):
context: ContextT context: ContextT
config: RunnableConfig config: RunnableConfig
stream_writer: StreamWriter stream_writer: StreamWriter
tools: list[BaseTool]
tool_call_id: str | None tool_call_id: str | None
store: BaseStore | None store: BaseStore | None
tools: list[BaseTool] = field(default_factory=list)
execution_info: ExecutionInfo | None = None execution_info: ExecutionInfo | None = None
server_info: ServerInfo | None = None server_info: ServerInfo | None = None
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "langgraph-prebuilt" name = "langgraph-prebuilt"
version = "1.0.12" version = "1.0.13"
description = "Library with high-level APIs for creating and executing LangGraph agents and tools." description = "Library with high-level APIs for creating and executing LangGraph agents and tools."
authors = [] authors = []
requires-python = ">=3.10" requires-python = ">=3.10"
+13
View File
@@ -2016,6 +2016,19 @@ async def test_tool_node_inject_runtime_dynamic_tool_via_wrap_tool_call_async()
assert tool_message.tool_call_id == "call_dynamic_2" assert tool_message.tool_call_id == "call_dynamic_2"
def test_tool_runtime_defaults_tools_to_empty_list() -> None:
runtime = ToolRuntime(
state={},
context=None,
config={},
stream_writer=lambda *args, **kwargs: None,
tool_call_id=None,
store=None,
)
assert runtime.tools == []
def test_tool_runtime_forwards_execution_info_server_info_and_tools() -> None: def test_tool_runtime_forwards_execution_info_server_info_and_tools() -> None:
"""Test that execution_info, server_info, and tools are forwarded from Runtime to ToolRuntime.""" """Test that execution_info, server_info, and tools are forwarded from Runtime to ToolRuntime."""
from langgraph.runtime import ExecutionInfo, ServerInfo from langgraph.runtime import ExecutionInfo, ServerInfo
+1 -1
View File
@@ -490,7 +490,7 @@ test = [
[[package]] [[package]]
name = "langgraph-prebuilt" name = "langgraph-prebuilt"
version = "1.0.12" version = "1.0.13"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "langchain-core" }, { name = "langchain-core" },
+1 -1
View File
@@ -413,7 +413,7 @@ test = [
[[package]] [[package]]
name = "langgraph-prebuilt" name = "langgraph-prebuilt"
version = "1.0.12" version = "1.0.13"
source = { editable = "../prebuilt" } source = { editable = "../prebuilt" }
dependencies = [ dependencies = [
{ name = "langchain-core" }, { name = "langchain-core" },