Skip to content

Add subscription-login provider bridges via local CLI subprocess#12

Merged
Xiangyue-Zhang merged 1 commit into
mainfrom
feat/subscription-cli-providers
Apr 18, 2026
Merged

Add subscription-login provider bridges via local CLI subprocess#12
Xiangyue-Zhang merged 1 commit into
mainfrom
feat/subscription-cli-providers

Conversation

@Xiangyue-Zhang
Copy link
Copy Markdown
Owner

Summary

Two new provider values that reuse existing flat-rate subscriptions instead of per-token API billing:

  • claude_cli — shells out to the local claude -p binary
  • codex_cli — shells out to the local codex exec binary

The dispatcher flattens (system + messages) into one prompt, pipes it to the CLI, and returns stdout as the assistant reply. Per-token API paths (anthropic, openai) are untouched and remain the default.

Why

Running many 24/7 agents in parallel is much cheaper on an existing subscription than on per-token billing, especially during heavy Think / Reflect cycles.

Changes

  • core/agents.py — new SUPPORTED_PROVIDERS constant + validation, _call_llm dispatch extended with two new branches, new helpers _flatten_for_cli, _run_cli, _call_claude_cli, _call_codex_cli. Defensive: missing binary, non-zero exit, and 10-min timeout all degrade to a structured wait-action JSON. Oversize argv falls back to stdin automatically.
  • config.yaml — extended provider / model commentary to cover all four options.
  • README.md — new API key vs. subscription table under Supported LLM Providers; added changelog entry under Recent Updates.
  • AI_GUIDE.md, CLAUDE.md — Step 3 rewritten to ask both "which vendor" and "API or subscription", with a trade-off note.

Test plan

  • python3 -c "from core.agents import AgentDispatcher" — all 4 providers construct; invalid provider raises ValueError.
  • Missing-binary fallback returns structured {"action":"wait",...} JSON without raising.
  • End-to-end smoke: set provider: "claude_cli" locally and run one Think cycle on a toy project. (Manual — requires the CLI to be installed on the host.)

Introduce two new `provider` values (`*_cli` variants) that reuse
existing flat-rate subscriptions instead of per-token API billing.
The dispatcher flattens (system + messages) into one prompt and
pipes it to the configured CLI binary; stdout becomes the assistant
reply. Oversize argv falls back to stdin. Missing-binary and
timeout cases degrade to a wait-action JSON instead of crashing the
agent loop.

Why: running many 24/7 agents in parallel is much cheaper on an
existing subscription than on per-token billing, especially during
heavy Think/Reflect cycles. The two per-token API paths are
untouched and remain the default.

Updates config.yaml, README and the two setup guides to document
the new options and the API-vs-subscription trade-off.
@Xiangyue-Zhang Xiangyue-Zhang merged commit b6fcc4a into main Apr 18, 2026
1 check passed
@Xiangyue-Zhang Xiangyue-Zhang deleted the feat/subscription-cli-providers branch April 18, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant