Implement JSONL RPC envelope for agent-orchestrator communication
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- api, backend-api-design, distributed-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Rust
- Star
- 64
- Fork
- 5
- Merge trung bình
- 1 giờ 17 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của terraphim/terraphim-ai
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
terraphim/terraphim-ai#885 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
terraphim/terraphim-ai#871 ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
terraphim/terraphim-ai#810 · 2 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
terraphim/terraphim-ai#729 ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
terraphim/terraphim-ai#728 ·
Tất cả issue của terraphim/terraphim-ai
Issue tương tự
-
contribution
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tree-sitter/tree-sitter#6005 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
agent:triaged bug bughunt pm:pipenv priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SocketDev/socket-patch#744 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
maplibre/maplibre-tile-spec#1844 ·
Maintainer thường phản hồi trong vòng 1 ngày