Skip to content

Add dispatch_launch_agent MCP tool for agent orchestration#708

Merged
selfcontained merged 6 commits into
mainfrom
agt_0321e1e0fe85/agent-e0fe85
Jun 30, 2026
Merged

Add dispatch_launch_agent MCP tool for agent orchestration#708
selfcontained merged 6 commits into
mainfrom
agt_0321e1e0fe85/agent-e0fe85

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Add dispatch_launch_agent MCP tool that lets agents launch other agents, enabling delegation, parallel work, escalation, and hand-off workflows
  • New tool follows existing dispatch_launch_persona / messaging-tools patterns — Zod schema, handler in mcp-handlers.ts, wired through routes and server
  • Defaults favor simplicity: child shares parent's worktree, inherits parent's agent type and fullAccess, fire-and-forget lifecycle
  • Fix sidebar to only nest persona/review children under parent cards — general launched agents show as top-level entries so agent-launches-agent chains don't disappear

Test plan

  • Unit tests for tool registration (6 tests: conditional registration, handler with required/optional params, error handling)
  • Type check (pnpm run check) passes
  • Full unit test suite passes (2064 server + 180 web)
  • E2E tests pass (171 passed, 12 pre-existing skips)
  • Live testing with live=true dev instance: basic launch, optional param overrides, invalid type rejection, tool discovery
  • Architecture review passed (round 1 approve + 1 low finding fixed, round 2 approve clean)

🤖 Generated with Claude Code

selfcontained and others added 6 commits June 29, 2026 21:30
Agents launched via dispatch_launch_agent have parentAgentId but no
persona — show them as normal top-level sidebar entries. Only persona
review agents are nested under their parent card.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Eliminates a second source of truth for the launchable agent type
enum — the schema now derives from the same CLI_AGENT_TYPES constant
the handler validates against.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…h_agent

Child agents can no longer escalate to fullAccess when the parent lacks it,
and known permission-bypass CLI flags are stripped from agentArgs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
No legitimate use case for exposing raw CLI arguments through the MCP tool.
The fullAccess flag already controls permission behavior, and agent type
selection covers the other meaningful variation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Keyboard agent cycling (focus-next/prev-agent) now uses the same
top-level predicate as the sidebar, so launched non-persona children
participate in hotkey navigation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit 22ed2a0 into main Jun 30, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_0321e1e0fe85/agent-e0fe85 branch June 30, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant