Commit Graph
124 Commits
Author SHA1 Message Date
RCD e040fdb330 chore: merge upstream CLIProxyAPI v6.9.15
# Conflicts:
#	.gitignore
#	README.md
#	README_CN.md
#	README_JA.md
#	cmd/server/main.go
2026-04-05 13:55:36 +07:00
dinhkarateandClaude Opus 4.6 36efcc6e28 fix(vertex): include prefix in auth filename and validate at import
Address two blocking issues from PR review:
- Auth file now named vertex-{prefix}-{project}.json so importing the
  same project with different prefixes no longer overwrites credentials
- Prefix containing "/" is rejected at import time instead of being
  silently ignored at runtime
- Add prefix to in-memory metadata map for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 15:06:04 +07:00
Pham Quang Dinh a337ecf35c Merge branch 'router-for-me:main' into feat(vertex)/add-prefix-field 2026-03-17 11:48:40 +07:00
RCD 6628e20d8c fix(cmd): align model listing with codex tiers 2026-03-12 11:00:16 +07:00
RCD 960422f715 Merge upstream CLIProxyAPI v6.8.38–v6.8.39
Upstream changes:
- Antigravity v1.19.5→1.19.6: Claude 4-6 migration, new models, image_gen payload
- Comprehensive browser fingerprint and proxy tracing header scrubbing
- Whitelist-based header filtering (replaces blacklist approach)
- Singleton HTTP transport to prevent OOM from connection pool leaks
- Disable HTTP/2 ALPN in Antigravity client (fixes connection resets)
- Gemini: route gemini-3.1-flash-image, custom generationConfig passthrough
- GeminiCLI versioning and User-Agent streamlining
- Model registry: input/output modalities, token limits, generation methods
- Removed oauth-model-alias migration logic

Fork resolution:
- Keep both SupportedEndpoints (fork) and modality fields (upstream) in ModelInfo
- Keep our README, delete README_CN.md
2026-03-02 19:51:13 +07:00
hkfires 914db94e79 refactor(headers): streamline User-Agent handling and introduce GeminiCLI versioning 2026-03-02 13:04:30 +08:00
RCD 0af0ad14e5 Merge upstream CLIProxyAPI v6.8.28–v6.8.32
Upstream changes:
- Codex responses compaction payload compatibility
- Codex usage_limit_reached retry-after, deterministic parsing
- Codex refresh_token_reused non-retryable fix
- Qwen rate limiting and quota error handling
- Context management compatibility simplification
- Antigravity tool_result image fix, model list backfill, deep copy cache
- Auth auto-refresh interval/concurrency limiting
- Auth hook OnResult refactor (replaces MarkResult)
- Gemini-3.1-flash-image support
- Registry cleanup of outdated model definitions

Fork resolution:
- Accept upstream's consolidated conductor.go (auto-refresh, round-tripper)
- Delete stale conductor_oauth.go, conductor_token.go (upstream reversed split)
- Delete stale provider_rotation_test.go (references removed method)
2026-02-27 20:58:16 +07:00
maplelove fc0257d6d9 refactor: consolidate duplicate UA and header scrubbing into shared misc functions 2026-02-27 10:57:13 +08:00
maplelove 4040b1e766 Merge remote-tracking branch 'upstream/dev' into dev
# Conflicts:
#	internal/runtime/executor/antigravity_executor.go
2026-02-27 10:29:50 +08:00
RCD 6ffc26271c Merge upstream CLIProxyAPI v6.8.27
Upstream changes:
- Post-auth hook system (RequestInfo refactor + hook chain)
- Credential-based round-robin for gemini-cli virtual auths
- Codex additive device-code login flow
- File input passthrough for /chat/completions and /responses
- Gemini → OpenAI usage conversion fix
- Responses stream: model/usage in translated streams, valid SSE error chunks
- Revert reasoning effort clamping

Fork resolution:
- Keep both integrationManager (fork) and postAuthHook (upstream) in handler struct
2026-02-25 14:49:42 +07:00
test 492b9c46f0 Add additive Codex device-code login flow 2026-02-23 06:30:04 -05:00
RCD cf558dd166 Merge upstream CLIProxyAPI v6.8.18–v6.8.26
Upstream changes:
- Codex WebSocket executor and Codex response handlers
- Header passthrough (upstream response headers forwarded to clients)
- ExecuteStream returns *StreamResult (wraps channel + headers)
- Embeddings handler with synthetic fallback
- User ID cache for executors
- Gemini schema/request fixes
- New test coverage for bootstrap retries, error responses

Fork resolution:
- Delete upstream's modular TUI files (app.go, styles.go, dashboard.go,
  auth_tab.go, config_tab.go, keys_tab.go, logs_tab.go, oauth_tab.go,
  usage_tab.go, i18n.go, loghook.go) — keep fork's Flight Deck tui.go
- Add PassthroughHeaders field to SDKConfig
- Fix embeddings handler to capture 3-value ExecuteWithAuthManager return
- Update test mocks (conductor_test, auth_flow_test, multi_provider_test,
  gemini_executor_test) for new ExecuteStream signature
- Fix tuiMode → launchTUI flag variable reference
- Remove unused "io" import from main.go
2026-02-23 11:58:54 +07:00
maplelove dd71c73a9f fix: align gemini-cli upstream communication headers
Removed legacy Client-Metadata and explicit API-Client headers. Dynamically generating accurate User-Agent strings matching the official cli.
2026-02-22 17:07:17 +08:00
Luis Pater 7fe8246a9f Merge branch 'tui' into dev 2026-02-19 03:18:24 +08:00
RCD 4cf25c05ce Merge upstream CLIProxyAPI v6.8.15–v6.8.17
Upstream changes:
- feat: add Google One login and improve Gemini CLI auto-discovery
- feat: add gpt-5.3-codex-spark model definition
- feat: add 'kimi' channel support in model definitions
- feat: pass cache usage from codex to openai chat completions
- fix: normalize Gemini credential file prefix for consistency
- refactor: replace manual pointer assignments with new()
- chore: update Go to 1.26, update Codex client version

Fork fixes:
- Bump mise Go pin to 1.26.0
- Remove stale .syso resource files (incompatible with Go 1.26 linker)
2026-02-16 08:01:38 +07:00
lhpqaq 54ad7c1b6b feat(tui): add manager tui 2026-02-15 14:52:40 +08:00
Luis Pater 46a6782065 refactor(all): replace manual pointer assignments with new to enhance code readability and maintainability 2026-02-15 14:10:10 +08:00
RCD a987b9fb83 Merge upstream CLIProxyAPI v6.8.11 into ProxyPilot
Upstream changes (v6.8.0–v6.8.11):
- feat: add Kimi (Moonshot AI) provider support with OAuth
- feat: add iFlow provider with OAuth and cookie auth
- feat: support Claude thinking type adaptive
- feat: capture cached token count in usage metadata
- fix: correct max completion tokens for opus 4.6 thinking
- fix: improve content handling for system and user messages
- fix: rewrite model name in response.model for Responses API SSE
- refactor: simplify provider lifecycle and registration logic
- refactor: migrate config-access to internal package

Fork integration:
- Migrate configaccess from sdk/access/config to internal/access/config_access
- Update reconcile.go to use internalconfig types directly
- Add Kimi and iFlow login flags to ProxyPilot CLI
- Integrate managementasset auto-updater
- Keep all ProxyPilot fork features (TUI, agent setup, service, etc.)
2026-02-11 19:03:07 +07:00
sususu98 f3ccd85ba1 feat(gemini-cli): add Google One login and improve auto-discovery
Add Google One personal account login to Gemini CLI OAuth flow:
- CLI --login shows mode menu (Code Assist vs Google One)
- Web management API accepts project_id=GOOGLE_ONE sentinel
- Auto-discover project via onboardUser without cloudaicompanionProject when project is unresolved

Improve robustness of auto-discovery and token handling:
- Add context-aware auto-discovery polling (30s timeout, 2s interval)
- Distinguish network errors from project-selection-required errors
- Refresh expired access tokens in readAuthFile before project lookup
- Extend project_id auto-fill to gemini auth type (was antigravity-only)

Unify credential file naming to geminicli- prefix for both CLI and web.

Add extractAccessToken unit tests (9 cases).
2026-02-11 17:53:03 +08:00
RCD 90625182f3 remove(registry): delete Amazon Q model definitions
Remove GetAmazonQModels and its entry in the model listing.
2026-02-08 17:58:16 +07:00
RCD 346d8d3fb6 remove(cli): drop --amazonq-import flag and import command
Remove the CLI flag, variable, and DoAmazonQImport function.
2026-02-08 17:57:55 +07:00
testandClaude Opus 4.6 f5f26f0cbe Add Kimi (Moonshot AI) provider support
- OAuth2 device authorization grant flow (RFC 8628) for authentication
- Streaming and non-streaming chat completions via OpenAI-compatible API
- Models: kimi-k2, kimi-k2-thinking, kimi-k2.5
- CLI `--kimi-login` command for device flow auth
- Token management with automatic refresh
- Thinking/reasoning effort support for thinking-enabled models

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 19:24:46 -05:00
RCDandClaude 3986099409 refactor: remove unused loop index variable
Replace `for i, part := range` with `for _, part := range` since the
index variable was captured but never used (just discarded with `_ = i`).

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:57:03 +07:00
RCDandClaude 41b1ad654e feat(config): add oauth-model-alias migration support
Add migration logic for converting oauth-model-mappings to oauth-model-alias
with comprehensive test coverage.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:30:09 +07:00
dinhkarate 14cb2b95c6 feat(vertex): add --vertex-import-prefix flag for model namespacing 2026-01-29 13:32:38 +07:00
Luis Pater 8447fd27a0 fix(login): remove emojis from interactive prompt messages 2026-01-20 11:09:56 +08:00
Luis Pater 28726632a9 Merge pull request #861 from umairimtiaz9/fix/gemini-cli-backend-project-id
fix(auth): use backend project ID for free tier Gemini CLI OAuth users
2026-01-20 10:32:17 +08:00
Luis Pater a1da6ff5ac Fixed: #499 #985
feat(oauth): add support for customizable OAuth callback ports

- Introduced `oauth-callback-port` flag to override default callback ports.
- Updated SDK and login flows for `iflow`, `gemini`, `antigravity`, `codex`, `claude`, and `openai` to respect configurable callback ports.
- Refactored internal OAuth servers to dynamically assign ports based on the provided options.
- Revised tests and documentation to reflect the new flag and behavior.
2026-01-14 04:29:15 +08:00
Finessse 33fbfa7b53 feat(cli): add advanced account management commands
- Add -usage flag (token usage stats per provider)
- Add -logs flag (view recent logs, -n for line count)
- Add -refresh flag (force token refresh)
- Add -list-models flag (show available models)
- Add -export-accounts/-import-accounts (backup/restore)
- Add --include-tokens and --force flags for export/import
2026-01-12 04:30:45 +07:00
Finessse a09a23380e feat(cli): wire -quiet/-verbose flags to logging
- Add SetLogLevel() to logging package
- CLI flags override config-based log level
- Add tests for account.go (6 tests)
2026-01-12 02:26:06 +07:00
Finessse 5f8941b407 feat(cli): add account management commands
- Add -version, -status, -list-accounts flags
- Add -cleanup-expired, -remove-account for token management
- Add -json output mode for scripting
- Add -quiet/-verbose flags
- Colored terminal output with table formatting
2026-01-12 02:18:32 +07:00
Finessse 63da07d1f1 fix(cmd): update antigravity import to use new SDK method 2026-01-11 05:11:13 +07:00
Finessse 9679f69b81 feat(auth): add Gemini CLI token import for Antigravity
- Add internal/auth/antigravity package with token loading from ~/.gemini/oauth_creds.json
- Add ImportFromGeminiCLI method to AntigravityAuthenticator
- Add DoAntigravityImport CLI command
- Add --antigravity-import flag to server binary

Usage: proxypilot --antigravity-import
2026-01-11 04:10:54 +07:00
CodeIgnitor 52760a4eaa fix(auth): use backend project ID for free tier Gemini CLI OAuth users
Fixes issue where free tier users cannot access Gemini 3 preview models
due to frontend/backend project ID mapping.

## Problem
Google's Gemini API uses a frontend/backend project mapping system for
free tier users:
- Frontend projects (e.g., gen-lang-client-*) are user-visible
- Backend projects (e.g., mystical-victor-*) host actual API access
- Only backend projects have access to preview models (gemini-3-*)

Previously, CLIProxyAPI ignored the backend project ID returned by
Google's onboarding API and kept using the frontend ID, preventing
access to preview models.

## Solution
### CLI (internal/cmd/login.go)
- Detect free tier users (gen-lang-client-* projects or FREE/LEGACY tier)
- Show interactive prompt allowing users to choose frontend or backend
- Default to backend (recommended for preview model access)
- Pro users: maintain original behavior (keep frontend ID)

### Web UI (internal/api/handlers/management/auth_files.go)
- Detect free tier users using same logic
- Automatically use backend project ID (recommended choice)
- Pro users: maintain original behavior (keep frontend ID)

### Deduplication (internal/cmd/login.go)
- Add deduplication when user selects ALL projects
- Prevents redundant API calls when multiple frontend projects map to
  same backend
- Skips duplicate project IDs in activation loop

## Impact
- Free tier users: Can now access gemini-3-pro-preview and
  gemini-3-flash-preview models
- Pro users: No change in behavior (backward compatible)
- Only affects Gemini CLI OAuth (not antigravity or API key auth)

## Testing
- Tested with free tier account selecting single project
- Tested with free tier account selecting ALL projects
- Verified deduplication prevents redundant onboarding calls
- Confirmed pro user behavior unchanged
2026-01-05 02:41:24 +05:00
Finessse aafbdb9c46 feat(cmd): add Kilo Code and RooCode proxy configurations
Extend agent switching to support additional AI coding assistants
with their respective proxy settings.
2025-12-31 02:07:00 +07:00
Finessse 1a85ba0e17 feat(cmd): add agent configuration switch command
Add DoSwitch() and DoSwitchStatusAll() for switching agent configs
between proxy mode (routed through ProxyPilot) and native mode (direct
API access). Supports claude, gemini, codex, opencode, droid, cursor,
kilo, and roocode agents with backup/restore functionality.
2025-12-29 21:19:12 +07:00
Finessse 21101c7a03 feat(cmd): update run command with new login flags
- Add --minimax-login and --zhipu-login flags
- Add --amazonq-import and --kiro-import flags
- Integrate new auth providers into startup flow
2025-12-29 18:59:37 +07:00
Finessse 5099678f17 feat(cmd): enhance agent setup workflow
- Add comprehensive agent configuration wizard
- Support for multiple agent types (Claude Code, Codex, Cursor, etc.)
- Auto-detect existing configurations
- Improved user prompts and validation
2025-12-29 18:59:25 +07:00
Finessse b1653fc6d0 feat(cmd): enhance agent detection
- Improve agent detection logic for multiple CLI tools
- Add support for detecting Amazon Q CLI, OpenCode
- Better path resolution and state management
2025-12-29 18:59:16 +07:00
Finessse d3aa7ece4e refactor(cmd): update Kiro login flow
- Reorganize login methods (Google OAuth, AWS Builder ID)
- Add Kiro token import from IDE config
- Improve error handling and user feedback
2025-12-29 18:59:02 +07:00
Finessse f2c51915f0 feat(cmd): add Zhipu AI API key login
Add --zhipu-login CLI flag to prompt for and save Zhipu AI API key
2025-12-29 18:58:38 +07:00
Finessse ecbe4424cb feat(cmd): add MiniMax API key login
Add --minimax-login CLI flag to prompt for and save MiniMax API key
2025-12-29 18:58:28 +07:00
Finessse bc30977567 refactor(cmd): update auth manager for new providers
- Remove iFlow authenticator
- Add MiniMax authenticator
- Add Zhipu authenticator
2025-12-28 20:48:44 +07:00
Finessse 9e1cd7a61d refactor(cmd): remove iFlow CLI commands
Remove iFlow login and cookie authentication CLI commands.

Deleted files:
- internal/cmd/iflow_cookie.go
- internal/cmd/iflow_login.go
2025-12-28 20:47:24 +07:00
FinessseandClaude Opus 4.5 1a1c85f043 chore: cleanup and remove Letta integration
- Remove internal/letta/ package (unused memory bridge)
- Remove Letta references from run.go and start-cliproxy.ps1
- Move docker-build scripts to scripts/
- Move TROUBLESHOOTING_ANTIGRAVITY.md and WARP.md to docs/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 07:13:19 +07:00
FinessseandClaude Opus 4.5 12ac05a22f feat(cmd): add CLI agent auto-configuration
Generate config files to point CLI agents at ProxyPilot:
- Claude Code: ~/.claude/settings.json
- Codex CLI: ~/.codex/config.toml
- Factory Droid: ~/.factory/config.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 05:09:34 +07:00
FinessseandClaude Opus 4.5 af37fbf2e0 feat(cmd): add CLI agent detection
Detect installed CLI agents (Claude Code, Codex, Droid, Gemini)
by checking binaries and config files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 05:09:23 +07:00
FinessseandClaude Opus 4.5 221a386040 feat: sync with CLIProxyAPIPlus (excludes Amp, GitHub Copilot)
Synced all changes from router-for-me/CLIProxyAPIPlus including:

Executor updates:
- claude_executor: response decompression, beta extraction, model resolution
- gemini_executor/codex_executor: usage reporting
- antigravity_executor: fallback URLs, thinking metadata, token refresh
- kiro_executor: token refresh, profile ARN handling, quota fallback

Translator updates:
- Updated all translators for improved request/response handling
- Enhanced tool result formatting and streaming support

Configuration:
- Added IncognitoBrowser option for OAuth
- Updated KiroKey configuration
- Enhanced PayloadConfig options

SDK updates:
- Auth refresh registry improvements
- Cliproxy service enhancements
- Added ErrNotImplemented for executor interface

Excluded features (not synced):
- Amp CLI Integration module
- GitHub Copilot executor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 02:10:20 +07:00
FinessseandClaude Opus 4.5 8696d57ca6 feat(cmd): add Kiro login command
Add DoKiroLogin command for CLI authentication:
- AWS Builder ID device authorization flow
- Prompt-based auth method selection
- Token storage to auth directory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:54:12 +07:00
Luis Pater e755e567ea Merge branch 'router-for-me:main' into main 2025-12-21 19:54:13 +08:00