Skip to content

feat(runtime): multi-agent delegation + shared context#77

Merged
EmersonBraun merged 7 commits into
mainfrom
feat/multi-agent-delegation
Apr 6, 2026
Merged

feat(runtime): multi-agent delegation + shared context#77
EmersonBraun merged 7 commits into
mainfrom
feat/multi-agent-delegation

Conversation

@EmersonBraun

Copy link
Copy Markdown
Collaborator

Summary

  • Add agent:delegate:start and agent:delegate:end events to @agentskit/core
  • Add createSharedContext() to @agentskit/runtime with read-only view for child agents
  • Auto-generate synthetic ToolDefinition per delegate, injected into parent's tool list
  • Wire delegation into ReAct loop: regular tools run sequentially, delegates run in parallel via Promise.all
  • Recursive delegation with configurable maxDelegationDepth (default 3)
  • RuntimeConfig.delegates provides default registry, RunOptions.delegates overrides per-run
  • Child agent failures propagate as failed tool calls — parent LLM decides recovery

Test plan

  • 7 shared context unit tests pass
  • 3 buildDelegateTools unit tests pass
  • 8 delegation integration tests pass (single child, parallel, events, errors, shared context, depth limit, override)
  • 20 existing runner tests pass with no regressions
  • pnpm build succeeds across all packages
  • pnpm --filter @agentskit/runtime lint passes
  • pnpm --filter @agentskit/core lint passes

Closes #12

@EmersonBraun EmersonBraun merged commit 34b2032 into main Apr 6, 2026
1 check failed
@EmersonBraun EmersonBraun deleted the feat/multi-agent-delegation branch April 6, 2026 14:51
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.

Multi-agent delegation + shared context

1 participant