PoC: Claude Code subscription provider via ACP - #4398
Draft
sejas wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
Research (Anthropic's 2026 third-party OAuth policy, ACP protocol surface), architecture mapping, and drafting the design doc and implementation; all code was reviewed, typechecked, linted, unit-tested, and verified manually end-to-end.
Proposed Changes
Adds an opt-in third AI provider, "Claude Code · subscription", that runs Studio Code agent turns on the user's own Claude Pro/Max plan instead of the WPcom AI proxy — cutting proxy cost for users who already pay Anthropic.
Why this shape: since Jan–Apr 2026 Anthropic rejects subscription OAuth tokens in third-party harnesses, so Studio can't just point the existing pi runtime at a subscription token. The sanctioned path (the one Zed uses) is ACP — the Agent Client Protocol — fronting the official Claude Code / Agent SDK harness. Studio spawns the
@agentclientprotocol/claude-agent-acpadapter per turn, speaks ACP to it, and translates the stream back into Studio's existing event/session format, so the transcript UI, session persistence, and replay work unchanged. Studio never sees or stores the user's Claude credentials.User impact:
/provideroption "Claude Code · subscription" (CLI). Once selected, Agentic UI (studio ui) and headless turns run on the subscription.autoSelectable: false, unit-tested).studio mcpserver.Known trade-offs (details in the design doc): fresh ACP session per turn (long-conversation context fidelity), model picker ignored for ACP turns, tool calls auto-approved within the site directory, Electron packaging of the adapter out of scope.
Testing Instructions
claude→/login).npm install && npm run cli:build:uinode apps/cli/dist/cli/main.mjs code→/provider→ "Claude Code · subscription" (or set"aiProvider": "claude-code"in~/.studio/cli.json).node apps/cli/dist/cli/main.mjs ui --no-open→ http://localhost:8081 → new chat → send a prompt.node apps/cli/dist/cli/main.mjs code "Say OK" --jsonemits the standard event stream ending inturn.completedwithstatus: "success".npm run typecheckandnpm test -- apps/cli/aipass.Pre-merge Checklist