-
Notifications
You must be signed in to change notification settings - Fork 167
Description
Summary
Follow-up to #176 and the excellent fix in PR #180. The nested delegation inheritance works perfectly — child ooo run executions inherit parent MCP tools via PreToolUse hook injection and session forking. However, direct MCP-initiated executions (calling ouroboros_execute_seed / ouroboros_start_execute_seed from the main Claude session) do not inherit the parent session's MCP tools.
Current Behavior
When a user calls ooo run from their Claude Code session (which has MCP tools like mcp__github__*, mcp__chrome-devtools__*), the ExecuteSeedHandler.handle() in definitions.py creates an OrchestratorRunner without mcp_manager and without inherited tools:
# definitions.py:238-246
runner = OrchestratorRunner(
adapter=agent_adapter,
event_store=event_store,
console=console,
debug=False,
enable_decomposition=True,
inherited_runtime_handle=inherited_runtime_handle, # None for direct calls
inherited_tools=inherited_effective_tools, # None for direct calls
)The inherited_runtime_handle and inherited_effective_tools are only populated when the internal delegation fields (_ooo_parent_claude_session_id, _ooo_parent_effective_tools) are present in the tool arguments — which only happens when a parent orchestrator's PreToolUse hook injects them during nested execution.
For direct calls from the main Claude session, these fields are absent, so the runner starts with only DEFAULT_TOOLS = ["Read", "Write", "Edit", "Bash", "Glob", "Grep"].
Evidence
Smoke test on v0.25.1: a seed with AC "use mcp__github__issue_read to read issue 176" completed successfully, but the subagent's own output noted:
"The
mcp__github__issue_readMCP tool was not registered in this environment's tool set, so I used the GitHub REST API viacurlas a fallback."
The subagent used Bash + curl (available in DEFAULT_TOOLS) instead of the MCP tool.
Desired Behavior
Direct MCP-initiated ooo run executions should inherit the parent Claude session's effective MCP tool set, just as nested delegated runs do after PR #180.
Possible Approaches
The ExecuteSeedHandler runs inside the Ouroboros MCP server process, which doesn't have direct access to the parent Claude session's MCP tool registry. The delegation mechanism in PR #180 works because the parent orchestrator (running inside Claude) can inject metadata via hooks. For direct calls, the MCP server would need a way to discover which MCP tools the calling Claude session has available.
Some ideas (for maintainer consideration):
- Claude Agent SDK session info — if
claude_agent_sdkexposes the parent session's tool list, the handler could read it - MCP server configuration — allow the Ouroboros MCP server config to specify additional tools that should be available to all executions
- Tool list as explicit parameter — add an optional
additional_toolsparameter toexecute_seedfor the caller to pass their available tools
Context
- PR fix(#176): inherit parent MCP tools in delegated runs #180 fixed nested delegation perfectly — this is a follow-up enhancement, not a regression
- Workaround: run MCP-dependent tasks at the main conversation level instead of via
ooo run - Related: Bug: MCP tools silently dropped when spawning ooo run subagents #176 (original bug report)
Environment
- Ouroboros v0.25.1
- Claude Code with GitHub MCP + Chrome DevTools MCP configured in
~/.claude.json