Epic: Migrate ADF Claude agents to Agent SDK
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with cto-executive-system/knowledge/claude-agent-sdk-reference.md and cto-executive-system/plans/adf-architecture-improvements.md, then inspect crates/terraphim_spawner/src/lib.rs and dependency #688. The first deliverable is a spike comparing the three bridge options while preserving the Rust orchestrator; document the selected approach and split implementation work into the listed sub-issues.
索引モデルが issue の本文から書いたものです。
説明
Context
ADF spawns Claude agents as claude -p subprocesses with stdout/stderr capture. This causes SIGPIPE bugs, fragile output parsing, cold-start waste, and no native cost tracking. The Claude Agent SDK (renamed from Claude Code SDK) provides query() async iterator with typed hooks, native session resume/fork, and in-process cost tracking.
Proposal
Replace subprocess spawning for Claude-based agents with Agent SDK query() calls. Codex agents remain as subprocesses (no SDK equivalent).
Migration Strategy
- Create thin Python wrapper per agent that calls Agent SDK
query()and forwards typed JSONL events to stdout using the RPC envelope (#688) - Migrate one agent at a time: product-development first (lowest risk), then security-sentinel
- Preserve orchestrator reconciliation loop, Safety/Core/Growth layers, NightwatchMonitor
What This Eliminates
- SIGPIPE bug (async iterator, no pipes)
- Stdout/stderr parsing fragility (typed message stream)
- Cold-start waste (native
resume=session_id) - Cost tracking complexity (hooks on every API call vs output parsing)
- Session management complexity (
ClaudeSDKClienthandles state)
Open Question: Bridge Architecture
- Option A: Rust orchestrator -> thin Python wrapper (subprocess) -> Agent SDK
- Option B: Rust orchestrator -> local HTTP server running Agent SDK -> typed responses
- Option C: Implement Agent SDK protocol directly in Rust (high effort, fragile)
- Spike needed to determine which approach best preserves Rust orchestrator while gaining SDK benefits
Sub-issues (to be created during design phase)
- Spike: validate Agent SDK wrapper bridge pattern
- Migrate product-development agent to Agent SDK
- Implement cost tracking via Agent SDK hooks (supersedes #638 approach)
- Implement session resume via Agent SDK (supersedes #639 approach)
- Migrate security-sentinel agent to Agent SDK
References
- Agent SDK reference:
cto-executive-system/knowledge/claude-agent-sdk-reference.md - Current ADF subprocess model:
crates/terraphim_spawner/src/lib.rs - Comparison table: Agent SDK reference, "Comparison with Current ADF Setup" section
- Plan:
cto-executive-system/plans/adf-architecture-improvements.md(item 2.1) - Depends on: #688 (RPC envelope)
- Related: #637 (Paperclip epic), #638, #639
- 主要言語
- Rust
- スター
- 64
- フォーク
- 5
- 平均マージ
- 1時間 17分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
terraphim/terraphim-ai のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
terraphim/terraphim-ai#885 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
terraphim/terraphim-ai#871 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
terraphim/terraphim-ai#810 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
terraphim/terraphim-ai#729 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
terraphim/terraphim-ai#728 ·
terraphim/terraphim-ai の issue をすべて見る
似ている issue
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
stackabletech/kafka-operator#1033 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue needs testing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
farion1231/cc-switch#7744 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
datafusion
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/iceberg-rust#3297 ·
メンテナーはふだん 1 日以内に返信