Uh oh!
There was an error while loading. Please reload this page.
feat(runtime): decouple Swarm with asynchronous wakeups - #2384
Conversation
xxhZs
commented
Aug 7, 2026
Thanks for pushing the Swarm orchestration onto the durable Agent Graph. I found three blocking behavior gaps at
There is also a cross-host consistency gap: the Swarm-specific The focused Runtime/Runtime Host tests pass, but they do not exercise these end-to-end host lifecycle cases. |
likun666661
commented
Aug 7, 2026
@xxhZs Thanks for the detailed review. Addressed all four gaps in 9336ed0:
Validation:
I left the review state unresolved so you can verify the behavior and close it when satisfied. |
# Conflicts: # packages/runtime/src/__tests__/agent-swarm-tools.test.ts
Uh oh!
There was an error while loading. Please reload this page.
* docs: correct the multi-agent orchestration documents `docs/agent-swarm.md` still documented an `agent_swarm` tool that takes `items`, a `prompt_template` and `resume_run_ids`. That tool was removed in #2384, which deleted `agent-swarm-tools.ts` (where `AGENT_SWARM_TOOL_NAME = 'agent_swarm'` was defined) together with `adaptive-swarm.ts`, and replaced them with asynchronous supervision over the Agent Graph. `agent_swarm` survives only as a tool-result kind. Rewritten to describe what swarm is now: an orchestration mode rather than a tool. The mode is entered with `/swarm on|off|status|<task>` and changes four things — the system prompt, a guaranteed tool set that omits `view_agent_graph`, the durable `agentSwarmAuthorization` field on the Run header, and its own supervisor-wake rule in `isSwarmCheckpointTransition`. Items are ordinary child Sessions scheduled as graph work, and `agent_swarm_status` is a projection over the same graph snapshot, where `swarmId` is the `graphId`. The Agent Graph chapter carried four smaller defects, corrected in both languages: - `apps/desktop/src/main/agent-graph-ipc-main.ts` does not exist. Graph change events travel through `runtime-host-session-domains-ipc-main.ts` as `agentGraphChanged`, and the panel takes its types straight from `@maka/runtime-host/client` and `@maka/runtime-host/protocol`. - `apps/desktop/src/main/__tests__/graph-mode-host-contract.test.ts` was deleted and has no successor. - The comparison table described Agent Swarm as "one foreground tool call owns a bounded worker pool", which is the removed synchronous model. - The same table listed Agent Team beside four real mechanisms, but `AgentTeam` / `agent_team` / `mailbox` appear nowhere in the code. `docs/side-conversation.md` was audited as part of this group and needs no change: its unresolved symbols all sit in the Codex Reference and Desktop Architecture Snapshot sections, which describe OpenAI Codex rather than Maka. Refs #3522 Generated-by: Claude Opus 5 via Claude Code * docs: separate swarm's supervision policy from the graph's machinery The rewrite said swarm adds no execution machinery of its own and that wake state lives in the graph control plane, then described a mode-specific wake rule a few paragraphs later. Both are true — the graph stores wake state, while `isSwarmCheckpointTransition` decides when a swarm checkpoint is worth waking the supervisor for — but stated side by side they read as a contradiction. Say the split once, up front: one scheduler, one ledger, one control plane, all the graph's; what the mode adds is supervision policy over them. Refs #3522 Generated-by: Claude Opus 5 via Claude Code
Summary
agent_swarm_status, a compact status-only projection that excludes child logs, tool activity, reasoning, instructions, and partial outputsubagent_idmodel and connection when Graph provisions child sessions; the resolved agent id remains the durable topology keyagent_swarmexecutor, adaptive scheduler, exports, catalog entry, and host bindings from Desktop, CLI, and HeadlessBehavior
agent_listand schedules up to 32 preset-backed work items withupdate_agent_graph.yield_agent_graph; dispatch and normal running transitions do not wake it.agent_swarm; the asynchronous Graph path is the only batch execution path.Validation
@maka/core,@maka/runtime, CLI, Headless, and Desktop main-process builds pass/usr/localexecutable root expected bybuiltin-tools.testNotes
This is intentionally a draft for hands-on behavior testing. It reuses the existing SQLite-backed Agent Graph control plane instead of introducing a second background scheduler. Historical
agent_swarmresult decoding remains data compatibility only and is not callable.