Unify AI providers: Agent SDK OAuth + remove Claude Code CLI#73
Merged
luokerenx4 merged 5 commits intomasterfrom Mar 18, 2026
Merged
Unify AI providers: Agent SDK OAuth + remove Claude Code CLI#73luokerenx4 merged 5 commits intomasterfrom
luokerenx4 merged 5 commits intomasterfrom
Conversation
McpServer and transport are now created once at startup instead of per-request, following the official MCP SDK pattern. Fixes intermittent "No such tool available" errors caused by transient failures during per-request server recreation. Add setOnConfigChange() in config layer — all config write paths (writeConfigSection, writePlatformsConfig, writeAccountsConfig) now trigger a callback. main.ts registers mcpPlugin.restart() so MCP tool list stays in sync after any config change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revert MCP server to per-request transport (stateless SDK transport cannot be reused across requests). Fixes "No such tool" errors. Add loginMethod field to AI provider config: 'api-key' (default) or 'claudeai' (Claude Pro/Max via local Claude Code OAuth login). When claudeai is selected, Agent SDK strips ANTHROPIC_API_KEY from env and passes forceLoginMethod to the SDK, enabling API-key-free operation. Frontend: auth mode selector on AIProviderPage when agent-sdk backend is active, per-channel loginMethod override in ChannelConfigModal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete src/ai-providers/claude-code/ — Agent SDK replaces it entirely. Both spawn the same claude CLI under the hood, but Agent SDK delivers tools via in-process MCP (no external HTTP server needed). GenerateRouter drops the claudeCode parameter; 'claude-code' in config or per-request override is now an alias for 'agent-sdk'. Config migration in loadConfig() auto-converts backend: 'claude-code' → 'agent-sdk' + loginMethod: 'claudeai' on startup. Frontend reduced to two backend tabs: Agent SDK | Vercel AI SDK. Telegram compaction switched from askClaudeCode to askAgentSdk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mutation tools (closePosition, modifyOrder, cancelOrder) now remind AI to call tradingCommit before tradingPush. tradingPush returns an explicit error when staged-but-uncommitted ops exist. Frontend push panel shows uncommitted staged operations with a yellow indicator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…E.md Frontend: backend selector uses card UI with icons and descriptions instead of plain tabs. Auth section also uses cards with contextual hints (claude login instructions vs API key input). "Agent SDK" label replaced with "Claude" throughout UI. README: update features, architecture diagram (2 providers instead of 3), quick start, config table, and project structure to reflect Claude Code CLI provider removal. CLAUDE.md directory tree and architecture description updated to match. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
loginMethodconfig field (api-key/claudeai). When set toclaudeai, Agent SDK uses local Claude Code OAuth login (Claude Pro/Max subscription) instead of API key. No API key needed.src/ai-providers/claude-code/entirely. Agent SDK replaces it with better tool delivery (in-process MCP vs broken external HTTP MCP). Config migration auto-convertsbackend: 'claude-code'→agent-sdk+claudeaion startup.Test plan
backend: 'agent-sdk',loginMethod: 'claudeai', verify OAuth login worksloginMethod: 'api-key'with Anthropic key, verify API key mode worksbackend: 'claude-code'config auto-migrates on startupnpx tsc --noEmitpasses (backend + frontend)🤖 Generated with Claude Code