{"record":{"id":"a16d44f9fd75e305","repo":"langchain-ai/deepagents","slug":"task-tool-not-configured-for-this-eval","errorCode":null,"errorMessage":"task tool not configured for this eval","messagePattern":"task tool not configured for this eval","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/partners/quickjs/langchain_quickjs/_repl.py","lineNumber":593,"sourceCode":"    ) -> Any:\n        \"\"\"Validate JS `task()` input and invoke the runner on the right loop.\n\n        The QuickJS host call runs on the REPL worker loop, but subagent runnables\n        should execute on the parent LangGraph loop when one exists so callbacks,\n        context, and async loop affinity match normal tool execution.\n        \"\"\"\n        validated = self._validate_task_payload(payload)\n        description, subagent_type, label, response_schema = validated\n\n        async def _call() -> Any:\n            runtime = state.outer_runtime\n            if runtime is None:\n                msg = \"task() requires an active ToolRuntime\"\n                raise RuntimeError(msg)\n            task_tool = find_subagent_task_tool(getattr(runtime, \"tools\", ()) or ())\n            if task_tool is None:\n                msg = \"task tool not configured for this eval\"\n                raise RuntimeError(msg)\n            return await call_subagent_task_tool(\n                task_tool,\n                description=description,\n                subagent_type=subagent_type,\n                response_schema=response_schema,\n                runtime=runtime,\n                label=label,\n            )\n\n        outer_loop = state.outer_loop\n        if outer_loop is None:\n            return await _call()\n        current_loop = asyncio.get_running_loop()\n        if current_loop is outer_loop:\n            return await _call()\n        future = asyncio.run_coroutine_threadsafe(_call(), outer_loop)\n        try:\n            return await asyncio.wrap_future(future)","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/partners/quickjs/langchain_quickjs/_repl.py#L575-L611","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Python side, before enabling task() for JS\ntools = list(getattr(runtime, 'tools', ()) or ())\nassert any(t.name and 'task' in t.name.lower() for t in tools), 'task tool missing'","typeGuard":"def has_task_tool(runtime) -> bool:\n    from langchain_quickjs._repl import find_subagent_task_tool\n    return find_subagent_task_tool(getattr(runtime, 'tools', ()) or ()) is not None","tryCatchPattern":"try:\n    result = await task(payload)\nexcept (RuntimeError,) as e:\n    if 'not configured' in str(e):\n        log.warning('subagent task tool missing from runtime tools')\n        return None\n    raise","preventionTips":["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"],"tags":["quickjs","task-bridge","missing-tool"],"backgroundTag":"missing-tool-runtime","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}