Cherry-picked changes from CLIProxyAPI:
- fix(gemini): force type to string for enum fields (fixes Antigravity Gemini API error)
- feat(auth): add request_retry and disable_cooling per-auth overrides
- feat(auth): add skip persistence context key for file watcher events
Manually added RequestRetryOverride/DisableCoolingOverride methods to
types.go to preserve ProxyPilot's conductor.go compatibility while
gaining new functionality.
- Antigravity retry logic with improved error handling and capacity management
- Added request_id to error logs for better debugging
- Export OAuth constants from auth packages (antigravity, claude, codex, gemini)
- Added Antigravity AuthService in internal/auth/antigravity
- Updated Claude executor test expectations for system message handling
- Skip built-in tools in OAuth tool prefix
- Preserve displayName and description in Gemini models list
- Added Embed stubs for ProviderExecutor interface compliance
- Updated all executors with context cancellation handling
- Added payload rules using requested model
- Filter out Top_P when Temperature is set on Claude
- Remove empty system messages in translators
- Handle quota cooldown in retry logic
- Include requested model in executor metadata
- Normalize plan type filenames to lowercase
- Added Embed stubs for ProviderExecutor interface compliance
- Added payloadRequestedModel helper function
Major changes from upstream v6.7.16:
- Remove sessionID from signature caching API entirely
- CacheSignature(modelName, text, sig) instead of 4 params
- GetCachedSignature(modelName, text) instead of 3 params
- HasValidSignature(modelName, sig) instead of 1 param
- Add Gemini fallback: returns "skip_thought_signature_validator" on cache miss
- Add sliding expiration (TTL refresh on cache access)
- Add GetModelGroup() for grouping cache keys by model family
- Simplify antigravity executor by removing project switch logic
- Fix OpenAI Responses request handler to skip empty assistant text
- Fix OpenAI Responses request to validate full JSON before parsing
Local fixes for compatibility:
- Add Embed stub method to AntigravityExecutor for interface compliance
- Update test to clear cache for isolation (ThinkingBlockWithoutSignature)
- Update Gemini test to expect thinking blocks to be annotated not removed
- Fix gjson.Valid check before treating tool output as raw JSON
Port features from upstream CLIProxyAPI:
v6.7.13:
- Raw JSON payload rules (DefaultRaw, OverrideRaw)
- OpenCode instructions support with user agent detection
v6.7.14:
- Improve signature handling by associating with model name
v6.7.15:
- Unify model group references with GetModelGroup helper function
Features ported from upstream:
- feat(claude): add native request cloaking support
- feat(translator): add candidate count (n param) support for Gemini
- fix(translator): consolidate multiple system messages into single message (#1064)
- feat(codex): add config toggle for codex instructions injection
- feat(auth): add hashed account ID to credential filenames for team plans
- feat(config): add support for raw JSON payload rules (default-raw, override-raw)
- feat(codex): add OpenCode instructions based on user agent
Also includes minor whitespace cleanup and code organization.
The checkSystemInstructions was being called on every request but the
cloaking/system prompt handling is now done elsewhere. This removes
redundant processing.
Cherry-picked from CLIProxyAPI: 7831cba9
Extract session ID from metadata.user_id field when available, using
the "session_" prefix marker. Falls back to first user message hash.
Cherry-picked from CLIProxyAPI: 6184c433 (Fixed: #1109)
Update tests to reflect the new signature handling behavior where only
cached signatures are used, not client-provided ones. This prevents
"Corrupted thought signature" errors when switching between Claude and
Gemini models.
Tests now properly cache signatures before testing conversion functions.
Add support for Imagen 3.0 and 4.0 image generation models in Vertex AI:
- Add 5 Imagen model definitions (4.0, 4.0-ultra, 4.0-fast, 3.0, 3.0-fast)
- Implement :predict action routing for Imagen models
- Convert Imagen request/response format to match Gemini structure
- Transform prompts to Imagen's instances/parameters format
- Convert base64 image responses to Gemini-compatible inline data
Cherry-picked from CLIProxyAPI: 8734d4cb
Add InfoByProvider map to ModelRegistration to store provider-specific
ModelInfo, enabling different capabilities for the same model across
providers (e.g., direct API vs OpenRouter).
Changes:
- Add InfoByProvider field to ModelRegistration struct
- Update GetModelInfo to accept provider parameter for provider-specific lookup
- Update LookupModelInfo to accept variadic provider parameter
- Add LookupStaticModelInfo for fallback to static model definitions
- Update ApplyThinking to pass providerKey for registry lookups
- Update all GetModelInfo callers to use new signature
- Remove ensureMaxTokensForThinking test (function moved to thinking package)
Ported from CLIProxyAPI e641fde2
Move ensureMaxTokensForThinking logic from claude_executor to
thinking/provider/claude/apply.go. This centralizes Claude-specific
thinking budget constraints in the thinking package.
Cherry-picked from c421d653.
Add 6th parameter 'original' to applyPayloadConfigWithRoot to support
checking defaults against the original payload. This enables proper
default rule validation when translating between formats.
Based on upstream 2a663d5c.
- Comment out client signature extraction (incompatible across model families)
- Use only cached signatures for thinking blocks
- Switch to thinking.GetThinkingText for text extraction
- Add explanatory comment about cross-model signature issues
Cherry-picked from d4bb4e66.
- Remove static Name mapping from AntigravityModelConfig
- Add new model entries: claude-sonnet-4-5, gpt-oss-120b-medium, tab_flash_lite_preview
- Add model skip list for unlisted models
- Update thinking limits (Max: 128000, ZeroAllowed: true)
Cherry-picked from c175821c.
Rename include_thoughts to includeThoughts across all translator files
for consistency with the Gemini API field naming convention.
Cherry-picked key change from d5ef4a6d.
Port the internal/thinking package from CLIProxyAPI for unified thinking
configuration processing across all AI providers.
Features:
- Core types: ThinkingConfig, ThinkingMode, ThinkingLevel, SuffixResult
- Suffix parsing: model-name(16384) or model-name(high) syntax
- Validation: auto-conversion between budget/level formats, clamping
- Provider appliers: claude, gemini, antigravity, openai, codex
- Config extraction: extract thinking config from various request formats
- Stripping: remove thinking config for non-supporting models
Registry updates:
- Add UserDefined field to ModelInfo for passthrough behavior
- Add LookupModelInfo function for model capability lookup
- 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.
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.
- Add Auto-Updates and Rollback Support features to Features list
- Add Auto-Updates section with configuration options
- Add Rollback Support section explaining crash detection and recovery
- Document tray menu options for updates and rollback
Tray app integration:
- Health check on startup with auto-rollback trigger
- Background update polling with configurable interval
- One-click update menu item (shown when available)
- Manual rollback menu item in Settings
- Mark healthy after 30s of stable operation
- Graceful cleanup on exit (stop engine, stop poller)
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.
New UpdateBanner component for dashboard:
- Auto-checks for updates on mount with 2s delay
- Shows dismissible banner when update available
- Session-based dismissal persistence
- Download progress bar during update
- Integrated into App.tsx main layout
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
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
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)
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)
- 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
- 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