Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(agent): add debug logging for owner context resolution

Steven Enamakelf27ce2316de2
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs
index 5f09723db2..6c98fac127 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs
@@ -50,6 +50,11 @@ impl SpawnSubagentTool {
match SubagentSessionStore::new_in_context(&dispatch, parent.workspace_dir.clone()) {
Ok(store) => store,
Err(error) => {
+ log::debug!(
+ run_context_core_bound = run_context.core.is_some(),
+ dispatch_resolved = dispatch.resolved().is_some(),
+ "[spawn_subagent] caller owner context unavailable"
+ );
return Ok(ToolResult::error(format!(
"spawn_subagent: failed to open the caller-scoped session store: {error}"
)));
diff --git a/crates/openhuman-core/src/agent_runs/agent_chat/controllers.rs b/crates/openhuman-core/src/agent_runs/agent_chat/controllers.rs
index ad5280535d..f44fdc1507 100644
--- a/crates/openhuman-core/src/agent_runs/agent_chat/controllers.rs
+++ b/crates/openhuman-core/src/agent_runs/agent_chat/controllers.rs
@@ -138,6 +138,11 @@ fn handle_agent_chat(
// spawned tools) has settled. The run context carries only a weak
// reference so a persisted session cannot pin a tenant indefinitely.
let core_lease = ctx.resolved();
+ log::debug!(
+ "[agent_chat] one-shot owner context resolved headless={} bound={}",
+ ctx.is_headless_agent_chat(),
+ core_lease.is_some()
+ );
let target = match params.agent_id.as_deref().map(str::trim) {
Some(id) if !id.is_empty() => super::AgentChatTarget::AgentId(id),
_ => super::AgentChatTarget::Orchestrator,