Repository navigation
feat(mcp): add orchestration agents - #161
Closed
Juliusolsson05 wants to merge 1 commit into
Closed
Juliusolsson05 wants to merge 1 commit into
Juliusolsson05 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the orchestration MCP domain on top of the built-in MCP host from #162.
An MCP-enabled parent agent can create real Agent Code child agents, send them prompts, and list the children it owns. These are normal visible Dispatch agents, not hidden subprocesses, so the user can inspect and manage the work while the parent agent coordinates it.
Closes #156.
Requires #162 first.
Behavior
Adds three MCP tools under the
orchestrationdomain:orchestration_create_agent— creates a Claude or Codex child agent in Dispatch, optionally withcwd,title,role,runId, initialprompt, and childbuiltInMcpDomains.orchestration_send_prompt— sends a follow-up prompt to an orchestration-created child session.orchestration_list_agents— lists this parent session's orchestration children, optionally filtered byrunId.Prompt submission uses bracketed paste, matching the composer path for long markdown-heavy prompts. For Claude, the sender waits briefly for the paste placeholder before submitting.
Design
Orchestration creation is split between main and renderer deliberately:
OrchestrationBridgetherefore sends a typedorchestration:requestIPC message to the renderer and waits for a typed response. The renderer creates/list agents through the existing workspace/session actions, so orchestration children are real Agent Code sessions in the same UI model as manually-created sessions.Orchestration metadata is intentionally separate from linked-agent metadata. This PR adds
orchestrationParentId,orchestrationRootId,orchestrationRunId, andorchestrationRoleinstead of reusinglinkedParentId, because linked agents are a manual UI affordance while orchestration agents are programmatic workers with different lifecycle and future controls.Files
src/mcp/shared/orchestrationTypes.ts— typed orchestration requests/responses and agent records.src/main/orchestration/OrchestrationBridge.ts— main-to-renderer request bridge with timeout handling.src/main/ipc/orchestration.tsandsrc/preload/api/orchestration.ts— IPC surface for renderer orchestration responses.src/mcp/runtime/createBuiltInMcpServer.ts— registers the orchestration tools when the session scope includesorchestration.src/mcp/runtime/BuiltInMcpHttpHost.tsandsrc/main/index.ts— dependency wiring so MCP tools can reachSessionManagerandOrchestrationBridge.src/renderer/src/workspace/hook/actions/pane.tsandsrc/renderer/src/workspace/hook/index.ts— renderer-side create/list implementation.src/renderer/src/workspace/types.ts— orchestration metadata fields onSessionMeta.Verification
Live-exercised during development with the built-in MCP server enabled:
orchestration_list_agentsreturnedokwith the expected child list.orchestration_create_agentcreated visible Claude/Codex Dispatch child agents and returned their session ids.orchestration_send_promptsubmitted follow-up prompts to those children.tsc -bwas attempted. The orchestration files typecheck, but the repo still reports unrelated pre-existing errors from submodule type resolution and renderer files outside this PR.No test files added, per repo policy.
Test Plan
builtInMcpDomains: ['orchestration'].orchestration_create_agentwith a Claude child and initial prompt; confirm a visible Dispatch agent appears and receives the prompt.orchestration_create_agentwith a Codex child and initial prompt; confirm the same.orchestration_list_agents; confirm only this parent's orchestration children are returned.list_agentswith arunIdfilter.orchestration_send_prompt; confirm the target child receives the follow-up.linkedParentId.Merge Order
Merge #162 first. This PR is stacked on
feat/built-in-mcp-foundationand should be retargeted tomainafter #162 lands if GitHub does not do that automatically.