open-multi-agent/src
JackChen b857c001a8
feat: agent delegation mechanism (#123)
Implements `delegate_to_agent` built-in tool (closes #63). Opt-in registration via `includeDelegateTool`; only wired up by `runTeam` / `runTasks` for pool workers. Guards: self-delegation, unknown target, cycle detection via `delegationChain`, depth cap (`maxDelegationDepth`, default 3), pool deadlock.

Delegation runs on ephemeral Agent instances via `AgentPool.runEphemeral` (pool semaphore only, no per-agent lock) so mutual delegation (A→B while B→A) can't deadlock. Delegated run `tokenUsage` surfaces via `ToolResult.metadata` and rolls into the parent runner's total before the next budget check; delegation tool_result blocks are exempt from `compressToolResults` and the `compact` strategy. Best-effort SharedMemory audit writes at `{caller}/delegation:{target}:{ts}-{rand}`.

Picks up @NamelessNATM's work from #84 and adds cycle detection, token aggregation, compression exemption, mutual-delegation deadlock fix (Codex P1), and tool_result-preservation on budget-exceeded (Codex P2).

Co-authored-by: NamelessNATM <hamzarstar@gmail.com>
2026-04-19 10:50:44 +08:00
..
agent feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00
cli Updated the DeepSeek provider help text 2026-04-16 15:21:50 +10:00
llm Change the default URL of deepseek. Change the example to use reasoner for architect. 2026-04-16 12:17:22 +10:00
memory feat: enforce dependency-scoped agent context (default-deny) (#87) 2026-04-10 03:09:58 +08:00
orchestrator feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00
task feat: enforce dependency-scoped agent context (default-deny) (#87) 2026-04-10 03:09:58 +08:00
team fix: use explicit crypto import for Node 18 compatibility 2026-04-02 23:46:43 +08:00
tool feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00
utils feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00
errors.ts feat: implement token budget management in agent and orchestrator (#71) 2026-04-06 23:14:08 +08:00
index.ts feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00
mcp.ts feat: add connectMCPTools() to register MCP server tools as agent tools 2026-04-09 20:05:20 +03:00
types.ts feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00