Commit Graph
1271 Commits
Author SHA1 Message Date
RCD 22f91dc48e feat(translator): add reasoning state tracking and improve reasoning summary handling
Improves handling of reasoning summaries in OpenAI Responses API translation.
Cherry-picked from CLIProxyAPI.
2026-01-19 06:09:19 +07:00
RCD ed136fef5d refactor(logging): centralize log directory resolution logic
- Add ResolveLogDirectory() for consistent log path resolution
- Add SetLogLevel() for string-based log level configuration
- Update ConfigureLogOutput() to take *config.Config parameter
- Update all callers to use simplified API

Cherry-picked from CLIProxyAPI with adaptations.
2026-01-19 06:07:51 +07:00
RCD 630102632f fix(antigravity): convert non-string enum values to strings for Gemini API
Gemini API requires enum values to be strings. This adds NormalizeEnumValues
to convert numeric or boolean enum values to their string representations.
Cherry-picked from CLIProxyAPI.
2026-01-19 06:01:28 +07:00
RCD 2e490cf8f2 fix(translator): add check for empty text to prevent invalid serialization
Prevents sending empty text fields to Gemini and Antigravity APIs which
could cause invalid JSON serialization. Cherry-picked from CLIProxyAPI.
2026-01-19 06:00:12 +07:00
RCD e845700b9e test(updates): add unit tests for update system
11 tests covering:
- Poller creation, channel setting, start/stop
- Rollback data directory handling
- Rollback info save/load operations
- Health check recording and marking
- Asset platform detection
- Download progress reader
2026-01-18 07:39:02 +07:00
RCD 3127555850 feat(updates): add rollback support with crash detection
New rollback module for version recovery:
- Version-aware backup metadata tracking
- Platform-specific restore (Windows batch, Unix swap)
- Crash loop detection via startup health monitoring
- Auto-rollback after 3 rapid failures in 30s window
- MarkHealthy() clears failure counter after stable run

Install module updated to save rollback info on update.
2026-01-18 07:34:57 +07:00
RCD 4c3d538979 feat(updates): add background update poller
New poller module for periodic update checks:
- Configurable polling interval
- Channel support (stable/prerelease)
- Callback-based notification system
- Global singleton for tray integration
- Graceful start/stop with context cancellation
2026-01-18 07:34:09 +07:00
RCD 4d14eeb608 feat(config): add auto-update configuration settings
Add UpdatesConfig struct with configurable options:
- auto-check: enable/disable automatic update checks
- check-interval-hours: polling frequency (default 24h)
- auto-download/auto-install: for future automation
- notify-on-update: toast notifications
- channel: stable/prerelease support

Includes helper methods with sensible defaults.
2026-01-18 07:33:31 +07:00
RCD 7fc975198d fix(translator): preserve multiple system prompts in Gemini requests
Cherry-pick from CLIProxyAPI v6.7.7 (f8f3ad8).

Fixes issue where only the last system/developer message was preserved
when multiple were provided. Added systemPartIndex counter to accumulate
parts across all system messages instead of overwriting at index 0.

Also fixed path inconsistency in gemini_openai_request.go where the
array branch incorrectly used request.systemInstruction instead of
system_instruction.

Fixes: router-for-me/CLIProxyAPI#1064
2026-01-17 08:10:59 +07:00
RCD f2eabe57c5 fix(codex): ensure instructions field exists in request body
Add check to ensure 'instructions' field exists in Execute, ExecuteStream,
and CountTokens functions before sending request to Codex API.

Cherry-picked from:
- CLIProxyAPI v6.7.4 (902bea2)
2026-01-16 15:25:50 +07:00
RCD a2d701b205 fix(executor): update gemini-3-pro model name check to use internal name
Change conditional check from gemini-3-pro-preview (alias) to
gemini-3-pro-high (internal name) for system instruction injection.

Cherry-picked from:
- CLIProxyAPI v6.7.3 (c3ef46f)
2026-01-16 15:25:50 +07:00
RCD 7b22c4fd4d feat(auth): cherry-pick CLIProxyAPI v6.6.108-109 core updates
- Add ensureAntigravityProjectID to fetch project_id during token refresh
- Simplify filestore Save() to use os.O_TRUNC instead of temp file rename
- Auto-fetch project_id for antigravity provider in readAuthFile()
- Add metadataEqualIgnoringTimestamps to prevent refresh loops
- Use reflect.DeepEqual for cleaner metadata comparison

Cherry-picked from:
- CLIProxyAPI v6.6.108 (086eb3d)
- CLIProxyAPI v6.6.109-dev (7248f65)
2026-01-16 15:25:49 +07:00
Finessse 4d33b21446 chore(pricing): update model pricing table for Jan 2026
- Add Claude 4.5 model variants (opus, sonnet, haiku)
- Add Gemini 2.0/2.5 Flash and Pro pricing
- Add OpenAI o3/o4-mini pricing
- Update date reference from Dec 2024 to Jan 2026
2026-01-12 07:37:44 +07:00
Finessse f415504d35 feat(api): add rate limits monitoring endpoints
- GET /v0/management/rate-limits - detailed per-credential status
- GET /v0/management/rate-limits/summary - availability overview
- Shows available, cooling_down, disabled counts and next recovery time
2026-01-12 07:37:03 +07:00
Finessse 522f0e5c89 feat(windows): add single-instance mutex and Windows service support
- winutil package with mutex-based single instance lock
- Toast notification helper for Windows
- Service stubs for future Windows service mode
2026-01-12 07:36:43 +07:00
Finessse d6dd24e2b7 feat(tui): add polished Flight Deck terminal dashboard
- Bubbletea-based TUI with 5 tabs: Status, Accounts, Rate Limits, Usage, Logs
- Industrial control room aesthetic with orange/green color scheme
- Double-line borders (╔═╗), active tab indicator 【】
- 3-column stat boxes on Status, 4-column on Usage
- Visual gauge bar for rate limit availability
- Config-optional mode allows TUI to run without config.yaml
- Full-width frame with properly aligned borders
2026-01-12 07:33:04 +07: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 e8a6269a45 test: add tests for logging, errors, config, and auth packages
- Add 26 tests for SetLogLevel() in logging package
- Add 6 tests for AppError in errors package
- Add 10 tests for SDKConfig in config package
- Add 3 tests for EmailRequiredError in sdk/auth
2026-01-12 02:30:46 +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 68cfd33685 refactor(auth): remove unused GeminiCLI token aliases
- Remove dead code: GeminiCLIToken type alias, LoadGeminiCLIToken,
  LoadGeminiCLITokenFromPath (no callers found)
- Add tests for gemini auth (CredentialFileName, SaveTokenToFile)
2026-01-12 02:05:01 +07:00
Finessse b654a19a09 feat(gemini): enable thinking by default for Gemini 3 Flash 2026-01-11 14:28:59 +07:00
Finessse 46ad228707 sync(upstream): developer role + message_delta fix + auth cleanup
Cherry-picked:
- 7815ee33: adjust message_delta emission boundary in Claude-to-OpenAI
- 6762e081: add developer role support for Gemini translators
- 5e5d8142: fix auth error when antigravity refresh token missing
2026-01-11 06:45:24 +07:00
Finessse 741333697e sync(upstream): gemini thinking guards + thoughtSignature
Cherry-picked:
- 05444cf3: abort default injection on existing thinking keys
- 8edbda57: add thoughtSignature to node parts for Gemini/Antigravity

Skipped ef6bafbf (context cancellation) - structural conflict with our
multi-project fallback loops.
2026-01-11 06:45:24 +07:00
Finessse d3b5b0017f fix(config): preserve comments + deep copy nodes for YAML merge
Cherry-picked config fixes from upstream:
- 2e88c485: avoid adding new keys when merging
- ee552f87: deep copy nodes to prevent shared references
- c8e72ba0: preserve comment nodes during merge
- 09455f9e: additional merge edge case fixes

Kept our isZeroValueNode for smarter zero-value detection.
2026-01-11 06:33:53 +07:00
Finessse 9f5eb93f64 sync(upstream): add HttpRequest support across executors
Cherry-picked from e8e3bc86. Adds HttpRequest method to ProviderExecutor
interface for injecting credentials into arbitrary HTTP requests.

- Added HttpRequest to conductor.go interface
- Added HttpRequest stubs to kiro, minimax, zhipu executors
- Added http-request example
- Updated mock executors in tests

Also kept our Embed method and CountTokens implementations.
2026-01-11 06:32:53 +07:00
Finessse baf72225a5 sync(upstream): codex subscription dates + logger cleanup
Cherry-picked:
- 6494330c: add subscription date fields to ID token claims
- bc3195c8: remove unnecessary request details limit logic
2026-01-11 06:24:54 +07:00
Finessse 01e1d5aed2 sync(upstream): auth rotation atomic fix + memory leak fixes
- fix(auth): make provider rotation atomic (keep shouldKeepProviderOrder)
- fix(server): resolve memory leaks in failed attempts and codex cache
  - Add background cleanup goroutine for stale IP entries
  - Add cache expiry cleanup for codex prompt cache
- Update provider rotation tests for atomic rotation

Cherry-picked: 8be06255, 47dacce6
Merged with ProxyPilot's shouldKeepProviderOrder for gemini-3 fallback
2026-01-11 06:11:37 +07:00
Finessse 19bf935a2e sync(upstream): Gemini 3 Pro and Antigravity executor improvements
- feat(executor): enhance Antigravity payload with user role and dynamic system instructions
- feat(executor): add model-specific support for "gemini-3-pro" in execution
- feat(executor): update system instruction handling for Claude and Gemini-3-Pro models
- fix(executor): update gemini model identifier to gemini-3-pro-preview
- feat(executor): centralize systemInstruction handling

Cherry-picked: 67985d82, bda04eed, 1b2f9076, b6a0f7a0, 59a448b6
2026-01-11 06:03:27 +07:00
Finessse fd9d097b8e sync(upstream): management API and executor improvements
- feat(management): add generic API call handler
- Fix: disable thinking when tool_choice forces tool use
- feat(api): add ManagementTokenRequester interface (sans iflow)
- fix(management): refresh antigravity token for api-call $TOKEN$
- fix(auth): error when antigravity refresh token missing during refresh

Cherry-picked: ade71947, aca2ef63, ee171bc5, b01619b4, 5e5d8142
Adapted: removed iflow references (not in ProxyPilot)
2026-01-11 06:00:37 +07:00
Finessse 95bbb4d7f3 sync(upstream): add index field to image response for LiteLLM
- Uses json.Marshal for cleaner image payload construction
- Cherry-picked from upstream 671558a8, a7fc2ee4
2026-01-11 05:50:58 +07:00
Finessse a9cef821f9 sync(upstream): preserve built-in tools across openai<->responses
Cherry-picked from upstream 0b834fcb
2026-01-11 05:48:45 +07:00
Finessse a1620c5cb0 fix(auth): support both Antigravity IDE and Gemini CLI token paths
- Check OS-specific Antigravity path first, fallback to ~/.gemini/
- Add expiry_date field support (Unix ms timestamp)
- Windows: %APPDATA%\Antigravity -> %USERPROFILE%\.gemini
- macOS: ~/Library/Application Support/Antigravity -> ~/.gemini
- Linux: ~/.antigravity -> ~/.gemini
2026-01-11 05:20:13 +07:00
Finessse 63da07d1f1 fix(cmd): update antigravity import to use new SDK method 2026-01-11 05:11:13 +07:00
Finessse bcdbba5f76 fix(auth): read tokens from Antigravity IDE instead of Gemini CLI
Update token paths to OS-specific Antigravity locations:
- Linux: ~/.antigravity/oauth_creds.json
- macOS: ~/Library/Application Support/Antigravity/oauth_creds.json
- Windows: %APPDATA%\Antigravity\oauth_creds.json
2026-01-11 05:10:59 +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
Finessse 34f9bbd56e fix(auth): prevent race in kiro auth callback server shutdown 2026-01-10 06:03:03 +07:00
Finessse cddccdd5cb feat(executor): add project and model fallback on 429 for gemini-cli 2026-01-10 06:02:48 +07:00
Finessse 06c41e1a00 test(executor): add antigravity project switch integration test 2026-01-10 06:02:35 +07:00
Finessse 092cef6fa3 feat(executor): add project and model fallback on 429 for antigravity 2026-01-10 06:02:20 +07:00
Finessse 7806419df5 test(executor): add quota fallback unit tests 2026-01-10 06:02:06 +07:00
Finessse ff5a078229 feat(executor): add quota fallback helpers for project and model switching 2026-01-10 06:01:52 +07:00
Finessse db647820c9 fix(util): add kiro prefix fallback and reduce debug log noise 2026-01-09 23:41:57 +07:00
Finessse 8c991a8ed3 feat(registry): add kiro thinking model definitions 2026-01-09 23:41:39 +07:00
Finessse 123fd00c0a feat(executor): add kiro thinking model variants mapping 2026-01-09 23:41:25 +07:00
Finessse b87fe4580d fix(executor): update antigravity user-agent and add required headers 2026-01-09 23:41:11 +07:00
Finessse aeff3e8c09 fix(memory): handle cliproxyexecutor.Response in auth adapter 2026-01-09 23:40:53 +07:00
Finessse 3a8fac2514 feat(server): wire up lightweight profile toggles and configurable CORS 2026-01-09 23:40:39 +07:00
Finessse 283e8cfb52 feat(config): add lightweight profile options and CORS settings 2026-01-09 23:40:25 +07:00
Finessse 854bd25940 feat(cache): add max-bytes size limit for prompt cache 2026-01-09 23:40:10 +07:00