open-multi-agent/src/tool
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
..
built-in feat: agent delegation mechanism (#123) 2026-04-19 10:50:44 +08:00
executor.ts feat: add tool output auto-truncation (#110) (#115) 2026-04-16 17:40:08 +08:00
framework.ts feat: add tool output auto-truncation (#110) (#115) 2026-04-16 17:40:08 +08:00
mcp.ts feat: update MCP GitHub example and added llmInputSchema 2026-04-12 00:01:22 +03:00
text-tool-extractor.ts fix(agent): merge abort signals instead of overriding caller's signal 2026-04-05 12:00:16 +08:00