Skip to content

feat: cross-machine and cross-team orchestration via phoenix-flow MCP #489

Description

@JustAGhosT

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
  1. Fetches task T-123 from phoenix-flow MCP (get_task)
  2. Spawns target CLI with task context injected
  3. On completion, writes result back to phoenix-flow (update_task, add_agent_message)
  4. 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:

  1. Agent writes task status update to phoenix-flow MCP (update_task status=done)
  2. retort run --watch --remote polls phoenix-flow for status changes (or receives webhook if phoenix-flow supports it)
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions