Summary
retort run --watch handles local file-based orchestration via RuntimeStateManager (#486). This issue tracks the next layer: cross-machine agent handoffs and human+agent cross-team coordination.
Problem
When agents run on different machines (e.g., a remote GitHub Actions runner spawning Claude Code, or a human engineer handing off a task to an AI team), file-watching over .claude/state/tasks/ doesn't work — there's no shared filesystem. We need a remote-accessible coordination layer.
Proposed Architecture
Local orchestration (same machine)
retort run --watch
└─ watches .claude/state/tasks/ ← RuntimeStateManager (fast, #486)
Remote / cross-team orchestration
retort run --watch --remote
└─ polls phoenix-flow MCP (task graph)
│
├─ Human team creates/assigns tasks on Kanban board
├─ Agent team picks up tasks via MCP tool calls
├─ Task lifecycle: todo → inprogress → done
└─ Syncs back to org-meta (YAML, version-controlled)
Key decisions
Why phoenix-flow (not mcp-org, not cognitive-mesh, not sluice)
| Repo |
Role |
Verdict |
phoenix-flow |
Shared task graph — human + agent, MCP server, bidirectional YAML sync |
Primary integration target |
mcp-org |
Org-level task mirror + project health (read-mostly) |
Audit/visibility layer only |
cognitive-mesh |
Enterprise AI governance + reasoning platform |
Too heavyweight; internal to CM agents |
sluice |
OpenAI-compatible LLM gateway |
Model routing, not orchestration |
docket |
FinOps / AOAI cost tracking |
Cost visibility, tangential |
codeflow |
Python AutoPR engine |
Another CLI retort run dispatches to |
phoenix-flow is already the designated shared task graph between humans and agents in this org — Portfolio → Project → Task hierarchy with MCP read/write and YAML version control.
Implementation sketch
retort run --remote flag
retort run claude --task T-123 --remote phoenix-flow
- Fetches task
T-123 from phoenix-flow MCP (get_task)
- Spawns target CLI with task context injected
- On completion, writes result back to phoenix-flow (
update_task, add_agent_message)
- Optionally logs to mcp-org audit trail (
log_agent_message)
.retortconfig extension (builds on #488)
remote:
provider: phoenix-flow
endpoint: ${PHOENIX_FLOW_URL}
secret: ${PHOENIX_FLOW_MCP_SECRET}
fallback: local # fall back to file-watching if remote unreachable
Callback protocol for remote CLIs
When a remote agent (e.g., codeflow AutoPR on a runner) completes work:
- Agent writes task status update to phoenix-flow MCP (
update_task status=done)
retort run --watch --remote polls phoenix-flow for status changes (or receives webhook if phoenix-flow supports it)
- Next agent in chain is dispatched with the updated task context
Human↔agent handoff
- Human moves task card on Kanban → phoenix-flow writes status to DB →
retort run --watch --remote picks it up → spawns designated agent CLI
- Agent completes → updates task → human sees it on board immediately
Acceptance criteria
Dependencies
Out of scope
- Phoenix-flow internal task graph changes (tracked separately in that repo)
- Cognitive-mesh agent orchestration (CM manages its own agent graph internally)
- Real-time streaming (polling is sufficient for v1; webhooks are a follow-up)
Summary
retort run --watchhandles local file-based orchestration viaRuntimeStateManager(#486). This issue tracks the next layer: cross-machine agent handoffs and human+agent cross-team coordination.Problem
When agents run on different machines (e.g., a remote GitHub Actions runner spawning Claude Code, or a human engineer handing off a task to an AI team), file-watching over
.claude/state/tasks/doesn't work — there's no shared filesystem. We need a remote-accessible coordination layer.Proposed Architecture
Key decisions
Why phoenix-flow (not mcp-org, not cognitive-mesh, not sluice)
phoenix-flowmcp-orgcognitive-meshsluicedocketcodeflowretort rundispatches tophoenix-flowis already the designated shared task graph between humans and agents in this org — Portfolio → Project → Task hierarchy with MCP read/write and YAML version control.Implementation sketch
retort run --remoteflagT-123from phoenix-flow MCP (get_task)update_task,add_agent_message)log_agent_message).retortconfigextension (builds on #488)Callback protocol for remote CLIs
When a remote agent (e.g., codeflow AutoPR on a runner) completes work:
update_task status=done)retort run --watch --remotepolls phoenix-flow for status changes (or receives webhook if phoenix-flow supports it)Human↔agent handoff
retort run --watch --remotepicks it up → spawns designated agent CLIAcceptance criteria
retort run --remoteflag reads task from phoenix-flow MCP before dispatch.retortconfig remote:block supported (feat(config): extend .retortconfig schema with cli-routing, mcp-servers, and worktree settings #488 prerequisite)--remoteprovider is unreachableDependencies
retort run— multi-CLI team dispatch with .retortconfig routing #487 —retort runCLI dispatch (prerequisite).retortconfigschema extension (prerequisite)phoenixvc/phoenix-flow— MCP server must exposeupdate_task+add_agent_message(already present)Out of scope