mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-05-01 09:40:45 +08:00
fix(task_tool): fallback to configurable thread_id when context is mi… (#1343)
* 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
This commit is contained in:
@@ -86,6 +86,8 @@ async def task_tool(
|
|||||||
sandbox_state = runtime.state.get("sandbox")
|
sandbox_state = runtime.state.get("sandbox")
|
||||||
thread_data = runtime.state.get("thread_data")
|
thread_data = runtime.state.get("thread_data")
|
||||||
thread_id = runtime.context.get("thread_id") if runtime.context else None
|
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
|
# Try to get parent model from configurable
|
||||||
metadata = runtime.config.get("metadata", {})
|
metadata = runtime.config.get("metadata", {})
|
||||||
|
|||||||
Reference in New Issue
Block a user