From 690d80f46f09c615fc9500b959cec8f9181360f9 Mon Sep 17 00:00:00 2001 From: SHIYAO ZHANG <834247613@qq.com> Date: Sat, 28 Mar 2026 16:44:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(task=5Ftool):=20fallback=20to=20configurabl?= =?UTF-8?q?e=20thread=5Fid=20when=20context=20is=20mi=E2=80=A6=20(#1343)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(task_tool): fallback to configurable thread_id when context is missing task_tool only read thread_id from runtime.context, but when invoked via LangGraph Server, thread_id lives in config.configurable instead. Add the same fallback that ThreadDataMiddleware uses (PR #1237). Fixes subagent execution failure: 'Thread ID is required in runtime context or config.configurable' * remove debug logging from task_tool --- backend/packages/harness/deerflow/tools/builtins/task_tool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/packages/harness/deerflow/tools/builtins/task_tool.py b/backend/packages/harness/deerflow/tools/builtins/task_tool.py index 9f3f13b..55a41e3 100644 --- a/backend/packages/harness/deerflow/tools/builtins/task_tool.py +++ b/backend/packages/harness/deerflow/tools/builtins/task_tool.py @@ -86,6 +86,8 @@ async def task_tool( sandbox_state = runtime.state.get("sandbox") thread_data = runtime.state.get("thread_data") thread_id = runtime.context.get("thread_id") if runtime.context else None + if thread_id is None: + thread_id = runtime.config.get("configurable", {}).get("thread_id") # Try to get parent model from configurable metadata = runtime.config.get("metadata", {})