Skip to content

ADR-002: Postpone Upgrading Web/Cron to Claude Agent SDK ​

  • Status: ✅ Accepted
  • Date: 2026-05-06
  • Decision Maker: longsizhuo + Claude

← ADR Index · Dual Path Background


Context ​

ADR-001 decided to maintain dual execution paths. However, the Web/Cron path currently uses DeepSeek + ThreadPool within the same process and is not true subagent isolation.

We investigated anthropics/claude-agent-sdk-python. Theoretically, it could allow Web/Cron to also use true Claude subagents:

  • Supports AgentDefinition + allowed_tools=["Task"] + fork_session() for true subagents
  • API design is consistent with Agent({subagent_type}) within Claude Code
  • Verified as functional through Context7 documentation

Theoretical benefits:

  • Web/Cron would also use true subagents (subprocess isolation), aligning architecture with the Skill path
  • Claude 4 model capabilities > DeepSeek-Chat
  • Marketing advantage: "100% real Agent Teams"

So why not proceed?


Decision ​

Postpone the upgrade. Web/Cron will continue using DeepSeek + ThreadPool.


Key Reasons for Rejection ​

1. Mandatory Claude Model, Cannot Use DeepSeek ​

claude-agent-sdk-python is a subprocess wrapper for the Claude Code CLI:

Python SDK → subprocess.run("claude --print ...") → Claude API

The subagent model is fixed to use the Claude subscription / API. It is not possible to run subagents on DeepSeek.

2. Cost Explosion: 30-100× ​

Actual comparison:

ModelSingle LLM CallSingle Committee (5-15 LLM Calls)Daily Cron Monthly Cost
DeepSeek-Chat¥0.001¥0.01-0.03¥0.30-1.00
Claude Sonnet 4~¥0.05¥0.5-2¥15-60
Claude Opus 4~¥0.20¥2-6¥60-180

Running cron daily = hundreds of RMB per month. Unacceptable for a solo open-source tool.

3. Requires Claude CLI on the Server ​

claude-agent-sdk-python is not a pure Python library; it is a CLI wrapper:

bash
# Must be done on the server first
curl -fsSL https://claude.ai/install.sh | bash
# Then the SDK can spawn the subprocess

This adds complexity to Docker image + systemd deployment.

4. The Two Paths Already Serve Distinct Purposes ​

ADR-001 explains:

  • The Skill path already uses true subagents + Claude model (user's Claude Code)
  • Web/Cron is for low cost + automation

User-initiated queries → Skill; Automation / Web GUI triggers → Web/Cron. Merging into an all-Claude system would eliminate this division of labor.

5. True Subagents Offer Limited Value for the Web Path ​

The current Web/Cron implementation achieves "information separation" through convention rather than subprocesses:

  • Each agent receives an independent prompt string
  • Each agent runs in an independent ThreadPool worker (no shared variables)
  • Tests cover the "information leakage" boundary

→ Same GIL, same process, indeed not physical isolation. But functionally equivalent. → Upgrading to true subagents would make no difference to user perception (CIO output remains the same format).


Consequences ​

Positive (Maintaining the Status Quo) ​

  1. Cron monthly cost is controllable (¥1 vs ¥60)
  2. Server deployment is simple (no Claude CLI required)
  3. Web response is fast (DeepSeek 2-3s/call vs Claude 5-10s/call)
  4. ADR-001 dual-path division of labor is clear

Negative ​

  1. Web/Cron is not "100% real Agent Teams" – slightly weaker from a marketing perspective
  2. DeepSeek model capability ceiling is lower than Claude, resulting in slightly lower quality for complex verdicts
  3. If the Skill path and Web/Cron path produce conflicting verdicts, there is no single authority
  4. A future drop in Claude API prices would not automatically enable this – a new ADR would be needed for re-evaluation

Alternatives Considered ​

A. OpenAI Agents SDK + DeepSeek ​

openai-agents-python supports AsyncOpenAI(base_url="https://api.deepseek.com") + OpenAIChatCompletionsModel. Switch the SDKAgent to use the OpenAI Agents SDK protocol, benefiting from standardization + a free OpenAI Traces dashboard.

Rejected:

  • Our own telemetry is sufficient (memory/llm_usage.jsonl + /api/llm/usage)
  • Protocol standardization is just a marketing gimmick
  • The ~3-4 hours of effort would be better spent on feature development

B. Build a Custom multiprocessing Wrapper + DeepSeek ​

Allow the Web path to also use multiprocessing.Pool for true subprocesses + DeepSeek, bypassing the Claude limitation.

Rejected:

  • Adds complexity with marginal benefit (information isolation is already guaranteed by convention)
  • Subprocess startup overhead (~200ms to start a Python process) would slow down the overall process

C. Wait for Claude Agent SDK to Support Non-Claude Models ​

If Anthropic opens the SDK to run other models in the future → adopt directly.

Rejected (for now): The future is uncertain; it's better to use DeepSeek now than to wait.


Reference ​

  • Complete Dual Path Design: 04-execution-paths.md
  • ADR-001: Necessity of Dual Paths: 001
  • Context7 Research Record (memory): project_invest_committee_paths.md

Triggers for Re-evaluation ​

  1. Claude API price drops to within 3× of DeepSeek
  2. User willingness to pay emerges (open-source project can sponsor ¥100/month for Claude cron)
  3. Claude Agent SDK supports non-Claude models
  4. A concrete use case demonstrates that "true subagent isolation" provides a quality improvement for the Web path (beyond architectural purity)