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>
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
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
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.
- 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.
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)
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.
- 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
Initialize response/prompt caches in Service.Run from config.
Add cache lookup to executor payload helpers.
Document cache config and management API in README.
Add utilities for estimating token counts using tiktoken
to support token-aware compression decisions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add KiroExecutor for AWS CodeWhisperer API:
- AWS Event Stream binary format parsing
- Kiro payload building with origin field
- Token refresh with mutex protection
- Quota fallback: AI_EDITOR -> CLI on 429
- Auto-refresh on 401/403 errors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>