langchain-ai/deepagents · error · RuntimeError
task tool not configured for this eval
Error message
task tool not configured for this eval
What it means
The task bridge raises this RuntimeError when the active ToolRuntime exists but contains no subagent task tool (`find_subagent_task_tool` returns None). `task()` cannot dispatch a subagent unless the task tool was configured in the runtime's toolset. This indicates the eval environment lacks subagent wiring despite subagents being enabled in the REPL.
Source
Thrown at libs/partners/quickjs/langchain_quickjs/_repl.py:593
) -> Any:
"""Validate JS `task()` input and invoke the runner on the right loop.
The QuickJS host call runs on the REPL worker loop, but subagent runnables
should execute on the parent LangGraph loop when one exists so callbacks,
context, and async loop affinity match normal tool execution.
"""
validated = self._validate_task_payload(payload)
description, subagent_type, label, response_schema = validated
async def _call() -> Any:
runtime = state.outer_runtime
if runtime is None:
msg = "task() requires an active ToolRuntime"
raise RuntimeError(msg)
task_tool = find_subagent_task_tool(getattr(runtime, "tools", ()) or ())
if task_tool is None:
msg = "task tool not configured for this eval"
raise RuntimeError(msg)
return await call_subagent_task_tool(
task_tool,
description=description,
subagent_type=subagent_type,
response_schema=response_schema,
runtime=runtime,
label=label,
)
outer_loop = state.outer_loop
if outer_loop is None:
return await _call()
current_loop = asyncio.get_running_loop()
if current_loop is outer_loop:
return await _call()
future = asyncio.run_coroutine_threadsafe(_call(), outer_loop)
try:
return await asyncio.wrap_future(future)View on GitHub (pinned to a1af029e6e)
Solutions
- Configure subagents so the task tool is present in the runtime's tools
- Disable subagents (`subagents_enabled=False`) if task() is not expected to work
- Log/inspect `runtime.tools` at eval start to confirm the task tool is registered
Defensive patterns
Strategy: validation
Validate before calling
# Python side, before enabling task() for JS tools = list(getattr(runtime, 'tools', ()) or ()) assert any(t.name and 'task' in t.name.lower() for t in tools), 'task tool missing'
Type guard
def has_task_tool(runtime) -> bool:
from langchain_quickjs._repl import find_subagent_task_tool
return find_subagent_task_tool(getattr(runtime, 'tools', ()) or ()) is not None Try / catch
try:
result = await task(payload)
except (RuntimeError,) as e:
if 'not configured' in str(e):
log.warning('subagent task tool missing from runtime tools')
return None
raise Prevention
- Build the agent with subagents configured whenever REPL has subagents_enabled=True
- Audit middleware/filters that may strip the task tool
- Log runtime.tools at eval start in dev environments
When it happens
Trigger: JS calls `task()` while `runtime.tools` contains no task tool — subagents enabled in the REPL config but the agent was built without subagent tools, or the tool list is empty/filtered.
Common situations: Config mismatch: REPL created with `subagents_enabled=True` but the agent's tool list omits the subagent task tool; tools filtered out by middleware; or using an eval harness that builds the runtime without subagents.
Related errors
- task() requires non-empty string field `description`
- task() requires non-empty string field `subagentType`
- task() field `label` must be a string when provided
- task() field `responseSchema` must be an object when provide
- task() requires an active ToolRuntime
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/a16d44f9fd75e305.
Report an issue: GitHub.