{"record":{"id":"b66e9ad93d722e06","repo":"tinyhumansai/openhuman","slug":"no-parent-context","errorCode":null,"errorMessage":"no parent context","messagePattern":"no parent context","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs","lineNumber":152,"sourceCode":"            .get(\"toolkit\")\n            .and_then(|v| v.as_str())\n            .map(|s| s.to_string());\n        let model_override = args\n            .get(\"model\")\n            .and_then(|v| v.as_str())\n            .map(|s| s.trim().to_string())\n            .filter(|s| !s.is_empty());\n\n        if agent_id.is_empty() || prompt.is_empty() {\n            tracing::warn!(\n                agent_id = %agent_id,\n                prompt_empty = prompt.is_empty(),\n                \"[spawn_worker_thread] rejected: agent_id and prompt are required\"\n            );\n            return Ok(ToolResult::error(\"agent_id and prompt are required\"));\n        }\n\n        let parent = current_parent().ok_or_else(|| anyhow::anyhow!(\"no parent context\"))?;\n\n        // ── Depth Guard ────────────────────────────────────────────────\n        // Check if the current thread is already a worker thread.\n        let current_thread_id =\n            crate::openhuman::agent::tinyagents::thread_context::current_thread_id()\n                .unwrap_or_else(|| \"unknown\".to_string());\n\n        tracing::info!(\n            agent_id = %agent_id,\n            task_title = %task_title,\n            current_thread_id = %current_thread_id,\n            toolkit_override = ?toolkit_override,\n            has_context = context.is_some(),\n            \"[spawn_worker_thread] invoked\"\n        );\n\n        let threads = conversations::list_threads(parent.workspace_dir.clone())\n            .map_err(|e| anyhow::anyhow!(e))?;","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs#L134-L170","documentation":"spawn_worker_thread requires an ambient agent-turn context (current thread/parent info it reads from the run context) and found none — the tool was invoked outside an orchestration session (no parent thread context available). It is a precondition sentinel: the tool only makes sense as a spawn from a parent agent turn, not from a bare/standalone invocation.","triggerScenarios":"Thrown at src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Invoke spawn_worker_thread only within an agent turn that has an active thread context","If surfacing via RPC/tests, provide the required parent context or use the session-based spawn API instead","Check for harness regressions where the context task-local is not propagated to tool execution"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}