Implement JSONL RPC envelope for agent-orchestrator communication
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust
调研方向
Start by reading docs/runtime-taskd-rpc-spec.md and item 1.3 in cto-executive-system/plans/adf-architecture-improvements.md, then inspect the Claude stream-json and Codex agent communication paths. Done means the proposed envelope, idempotency, typed errors, state recovery, and graceful Codex fallback are implemented across the listed integrations.
由索引模型根据 Issue 内容生成。
描述
Context
ADF currently communicates with agents via unstructured stdout/stderr pipes. This causes:
- SIGPIPE kills when stderr pipe is dropped
- Fragile text parsing for cost/session/status extraction
- No message framing, idempotency, or error typing
Proposal
Implement a JSONL envelope protocol inspired by Piwork's taskd RPC spec (docs/runtime-taskd-rpc-spec.md).
Envelope Format
Agent -> Orchestrator (event):
{"type": "event", "event": "cost_update", "agent": "security-sentinel", "ts": "...", "payload": {...}}
Orchestrator -> Agent (command, future):
{"id": "req_01", "type": "pause", "payload": {"reason": "budget_exceeded"}}
Key Properties
- Strict envelope:
{type, event/id, payload}(payload required even if empty) - Idempotency: duplicate request IDs with same payload produce no duplicate effects
- Typed error codes with retryable flag
- State recovery:
runtime_get_stateequivalent after reconnect
Integration
- For Claude agents: wrap
--output-format stream-jsonevents in ADF envelope - For Codex agents: gracefully degrade to unstructured mode
- New agents: require envelope support as spawn prerequisite
Benefits
- Foundation for cost tracking (#638), session persistence (#639), activity log (#641)
- Eliminates SIGPIPE bug (structured framing detects incomplete messages)
- Enables future Agent SDK migration
References
- Piwork taskd RPC spec: https://github.com/ferologics/Piwork/blob/main/docs/runtime-taskd-rpc-spec.md
- Plan:
cto-executive-system/plans/adf-architecture-improvements.md(item 1.3) - Blocks: #638, #639, #641
- 主要语言
- Rust
- 星标
- 62
- 派生
- 5
- 平均合并
- 2 小时 27 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
terraphim/terraphim-ai 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
terraphim/terraphim-ai#885 ·
-
难度 4/5 3-5 天 新手友好度 55/100
terraphim/terraphim-ai#871 ·
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
terraphim/terraphim-ai#810 · 2 条评论 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
terraphim/terraphim-ai#729 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
terraphim/terraphim-ai#728 ·
查看 terraphim/terraphim-ai 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
stratum-mining/stratum#2404 ·
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
bug team:backend track:services-maintenance
难度 2/5 1-3 小时 新手友好度 78/100
cowprotocol/services#4950 ·