Agent Relay Orchestrator
Manage multiple Claude Code workers from a single control point. Spawn, route, suspend, and resume persistent AI sessions with full context preservation.
Important: This skill assumes the Agent Relay Orchestrator is running on http://localhost:3890. Start it with npm start in the repo directory before using these commands.
Prerequisites
- - Claude Code CLI installed and authenticated
- Node.js 20+
- The orchestrator repo cloned and configured (see README)
Setup
CODEBLOCK0
API Endpoints
The orchestrator exposes an HTTP API on port 3890 (configurable via RELAY_PORT).
Health Check
CODEBLOCK1
Returns service status, active workers, and ticker state.
Spawn a Worker
CODEBLOCK2
Optional: pass "continueFrom": "<sessionId>" to resume a previous session.
Send a Message
CODEBLOCK3
If the target worker is suspended, it auto-resumes. If it doesn't exist but has a profile, it spawns.
List Active Workers
CODEBLOCK4
Returns name, status, label, project, and last message time for each active worker.
List All Projects
CODEBLOCK5
Shows all workers (active + suspended) with session IDs and profile info.
Suspend a Worker
CODEBLOCK6
Session is preserved for future resume. Add ?purge=true to clear session permanently.
Event Feed
CODEBLOCK7
Stats
CODEBLOCK8
Returns total events, total sessions, events in last 24h, and average latency.
Toggle Telegram Ticker
CODEBLOCK9
Example Workflows
Parallel Task Execution
CODEBLOCK10
Session Resume After Restart
CODEBLOCK11
Full Documentation
See the GitHub repo for architecture docs, Notion setup guide, and worker lifecycle details.
Agent Relay Orchestrator
从单一控制点管理多个Claude Code工作进程。生成、路由、挂起和恢复持久的AI会话,并完整保留上下文。
重要提示: 本技能假设Agent Relay Orchestrator运行在http://localhost:3890上。使用这些命令前,请在仓库目录中通过npm start启动它。
前提条件
- - 已安装并认证的Claude Code CLI
- Node.js 20+
- 已克隆并配置好的orchestrator仓库(参见README)
设置
bash
git clone https://github.com/TheAgentAcademy/agent-relay-orchestrator.git
cd agent-relay-orchestrator
npm install
cp .env.example .env
使用你的Notion凭证编辑.env文件
npm start
API端点
Orchestrator在3890端口上暴露HTTP API(可通过RELAY_PORT配置)。
健康检查
bash
curl http://localhost:3890/health
返回服务状态、活跃工作进程和ticker状态。
生成工作进程
bash
curl -X POST http://localhost:3890/spawn \
-H Content-Type: application/json \
-d {name: ReviewWorker, task: 你负责审查拉取请求并提出改进建议。}
可选:传递continueFrom: 以恢复之前的会话。
发送消息
bash
curl -X POST http://localhost:3890/send \
-H Content-Type: application/json \
-d {to: CodeWorker, text: 重构认证模块以使用JWT}
如果目标工作进程已挂起,它会自动恢复。如果不存在但有配置文件,则会生成。
列出活跃工作进程
bash
curl http://localhost:3890/workers
返回每个活跃工作进程的名称、状态、标签、项目和最后消息时间。
列出所有项目
bash
curl http://localhost:3890/projects
显示所有工作进程(活跃+挂起),包含会话ID和配置文件信息。
挂起工作进程
bash
curl -X DELETE http://localhost:3890/worker/ReviewWorker
会话被保留以供将来恢复。添加?purge=true可永久清除会话。
事件流
bash
所有事件
curl http://localhost:3890/events
自某个时间戳以来的事件
curl http://localhost:3890/events?since=2026-01-01T00:00:00Z&limit=50
特定工作进程的事件
curl http://localhost:3890/sessions/CodeWorker/events
统计信息
bash
curl http://localhost:3890/stats
返回总事件数、总会话数、过去24小时内的事件数以及平均延迟。
切换Telegram Ticker
bash
启用
curl -X POST http://localhost:3890/ticker \
-H Content-Type: application/json \
-d {enabled: true}
禁用
curl -X POST http://localhost:3890/ticker \
-d {enabled: false}
示例工作流
并行任务执行
bash
生成专门的工作进程
curl -X POST http://localhost:3890/spawn -d {name: TestWorker, task: 你负责运行测试并报告结果。}
curl -X POST http://localhost:3890/spawn -d {name: DocWorker, task: 你负责编写文档。}
并行发送任务
curl -X POST http://localhost:3890/send -d {to: TestWorker, text: 运行完整的测试套件}
curl -X POST http://localhost:3890/send -d {to: DocWorker, text: 更新新认证端点的API文档}
检查进度
curl http://localhost:3890/workers
重启后恢复会话
bash
工作进程状态已持久化。重启服务后:
npm start
CodeWorker自动恢复,包含完整的对话上下文
完整文档
请参阅GitHub仓库获取架构文档、Notion设置指南和工作进程生命周期详情。