Commit Graph
443 Commits
Author SHA1 Message Date
RCD 38e7f28233 Merge upstream CLIProxyAPI v6.7.53 into ProxyPilot
Changes (v6.7.49 - v6.7.53):
- feat(registry): add Claude 4.6 (Opus) model
- feat(registry): add GPT 5.3 Codex model
- fix(registry): correct Claude Opus 4.6 model metadata
- fix: enable extended thinking support for Claude Haiku 4.5
- refactor(executor): centralize Codex client version and user agent
- refactor(translator, executor): remove redundant bytes.Clone calls
- refactor(util): optimize JSON schema processing

Upstream: https://github.com/router-for-me/CLIProxyAPI/releases/tag/v6.7.53
2026-02-06 10:24:59 +07:00
Luis Pater b4e034be1c refactor(executor): centralize Codex client version and user agent constants
- Introduced `codexClientVersion` and `codexUserAgent` constants for better maintainability.
- Updated `EnsureHeader` calls to use the new constants.
2026-02-06 05:30:28 +08:00
Luis Pater a5a25dec57 refactor(translator, executor): remove redundant bytes.Clone calls for improved performance
- Replaced all instances of `bytes.Clone` with direct references to enhance efficiency.
- Simplified payload handling across executors and translators by eliminating unnecessary data duplication.
2026-02-06 03:26:29 +08:00
Luis Pater 09ecfbcaed refactor(executor): optimize payload cloning and streamline SDK translator usage
- Replaced unnecessary `bytes.Clone` calls for `opts.OriginalRequest` throughout executors.
- Introduced intermediate variable `originalPayloadSource` to simplify payload processing.
- Ensured better clarity and structure in request translation logic.
2026-02-06 01:44:20 +08:00
RCD 6c0c0b3a44 Merge upstream CLIProxyAPI v6.7.48 into ProxyPilot
Changes:
- feat(registry): add Kimi-K2.5 model to static data
- refactor(util, executor): optimize payload handling and schema processing
- fix(thinking): support user-defined includeThoughts setting (camelCase/snake_case)
- fix(thinking): ensure includeThoughts is false for ModeNone
- fix(gemini): support snake_case thinking config fields from Python SDK
- feat(gemini-cli): support image content in Claude request conversion
- fix(test): upstream fixed the builtin tools test we also fixed

Upstream: https://github.com/router-for-me/CLIProxyAPI/releases/tag/v6.7.48
2026-02-05 21:39:14 +07:00
Luis Pater 25c6b479c7 refactor(util, executor): optimize payload handling and schema processing
- Replaced repetitive string operations with a centralized `escapeGJSONPathKey` function.
- Streamlined handling of JSON schema cleaning for Gemini and Antigravity requests.
- Improved payload management by transitioning from byte slices to strings for processing.
- Removed unnecessary cloning of byte slices in several places.
2026-02-05 19:00:30 +08:00
RCD 7e3df456a5 Merge upstream CLIProxyAPI v6.7.42 into ProxyPilot
This merge brings in upstream changes from CLIProxyAPI v6.7.42 while
preserving ProxyPilot-specific customizations:

- Updated API server and executor modules
- New OAuth model alias functionality
- Enhanced thinking provider for iflow
- Updated model definitions and registry
- Improved docker build scripts

Conflicts were resolved by keeping ProxyPilot branding and merging
upstream improvements for translator and runtime components.
2026-02-03 11:08:58 +07:00
Luis Pater 250f212fa3 fix(executor): handle "global" location in AI platform URL generation 2026-02-03 01:39:57 +08:00
hkfires bc3bea72f3 refactor(codex): remove codex instructions injection support 2026-02-01 20:43:35 +07:00
hkfires ac802a4646 refactor(codex): remove codex instructions injection support 2026-02-01 14:33:31 +08:00
RCDandClaude 2f72e9801a fix: address 6 issues from Codex code review
kiro_request.go:
- Fix panic: safely truncate tokenKey for logging (was slicing [:8] without length check)
- Fix order: check EventStreamError BEFORE string pattern matching in isRetryableError

kiro_auth.go:
- Fix logic: isTokenExpired now returns true on parse failures (matches function contract)

conductor_token.go:
- Fix ignored param: StartAutoRefresh now respects caller-provided interval
- Fix race condition: protect refreshCancel with mutex in Start/StopAutoRefresh
- Fix wrong key: refreshAuth now uses executorKeyFromAuth for compat auths

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 13:11:51 +07:00
RCDandClaude 75ca091a73 refactor(executor): split kiro_executor.go into logical modules
Split the 3,891 line kiro_executor.go into focused modules:
- kiro_executor.go (966 lines): Main executor, public interface
- kiro_auth.go (462 lines): Authentication/credential logic
- kiro_request.go (422 lines): Request transformation and retry logic
- kiro_response.go (1,765 lines): Response handling/streaming

Fix: Corrected isRetryableError to use errors.As for EventStreamError
type assertion instead of errors.Is on string constants.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 12:09:33 +07:00
RCDandClaude 0db83010aa feat(config): add payload filter rules to remove JSON paths
Cherry-picked from upstream 6d8609e4

Allows configuring rules to remove specific JSON paths from request/response payloads.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:36:39 +07:00
RCDandClaude 977c5c18ad fix: handle issues #1372 #1366
Cherry-picked from upstream d216adef

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:36:17 +07:00
RCDandClaude 35b033ae06 fix(caching): ensure prompt-caching beta is always appended
Cherry-picked from upstream 7ff3936e

Adds multi-turn cache control tests.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:33:02 +07:00
RCDandClaude 39796063c5 feat(caching): implement Claude prompt caching with multi-turn support
Cherry-picked from upstream 3a43ecb1

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:30:10 +07:00
RCDandClaude 8473211ad6 fix(codex): avoid empty prompt_cache_key
Cherry-picked from upstream 04b22909

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:29:21 +07:00
RCDandClaude 4527e5a7e5 fix(openai): drop stream for responses/compact
Cherry-picked from upstream 53920b03

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:29:03 +07:00
RCDandClaude acdf099442 feat(openai): add responses/compact support
Cherry-picked from upstream 95096bc3

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:28:45 +07:00
Luis Pater 6d8609e457 feat(config): add payload filter rules to remove JSON paths
Introduce `Filter` rules in the payload configuration to remove specified JSON paths from the payload. Update related helper functions and add examples to `config.example.yaml`.
2026-02-01 05:29:41 +08:00
Luis Pater d216adeffc Fixed: #1372 #1366
fix(caching): ensure unique cache_control injection using count validation
2026-01-31 23:48:50 +08:00
Luis Pater f887f9985d Merge pull request #1248 from shekohex/feat/responses-compact
feat(openai): add responses/compact support
2026-01-31 03:12:55 +08:00
Luis Pater 7ff3936efe fix(caching): ensure prompt-caching beta is always appended and add multi-turn cache control tests 2026-01-31 01:42:58 +08:00
Martin SchneeweissandClaude Opus 4.5 3a43ecb19b feat(caching): implement Claude prompt caching with multi-turn support
- Add ensureCacheControl() to auto-inject cache breakpoints
- Cache tools (last tool), system (last element), and messages (2nd-to-last user turn)
- Add prompt-caching-2024-07-31 beta header
- Return original payload on sjson error to prevent corruption
- Include verification test for caching logic

Enables up to 90% cost reduction on cached tokens.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 22:59:33 +01: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
Shady Khalifa 04b2290927 fix(codex): avoid empty prompt_cache_key 2026-01-27 19:06:42 +02:00
Shady Khalifa 53920b0399 fix(openai): drop stream for responses/compact 2026-01-27 18:27:34 +02:00
RCD 1663148a32 feat: sync with upstream v6.7.25-26
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.
2026-01-27 22:08:43 +07:00
Shady Khalifa 95096bc3fc feat(openai): add responses/compact support 2026-01-26 16:36:01 +02:00
Luis Pater 70897247b2 feat(auth): add support for request_retry and disable_cooling overrides
Implement `request_retry` and `disable_cooling` metadata overrides for authentication management. Update retry and cooling logic accordingly across `Manager`, Antigravity executor, and file synthesizer. Add tests to validate new behaviors.
2026-01-26 21:59:08 +08:00
RCD 1d29f18172 feat: sync with upstream v6.7.22-24
- 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
2026-01-26 20:22:43 +07:00
Luis Pater 2af4a8dc12 refactor(runtime): implement retry logic for Antigravity executor with improved error handling and capacity management 2026-01-26 06:22:46 +08:00
hkfires f30ffd5f5e feat(executor): add request_id to error logs
Extract error.message from JSON error responses when summarizing error bodies for debug logs
2026-01-25 21:31:46 +08:00
Luis Pater 2e6a2b655c Merge pull request #1132 from XYenon/fix/gemini-models-displayname-override
fix(gemini): preserve displayName and description in models list
2026-01-25 03:40:04 +08:00
RCD 5be8c90506 feat: sync with upstream v6.7.19-21
- 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
2026-01-24 11:17:03 +07:00
Mauricio Allende f16461bfe7 fix(claude): skip built-in tools in OAuth tool prefix 2026-01-23 21:29:39 +00:00
RCD 377697331b feat: sync with upstream v6.7.17-18
- Updated gemini_schema.go with improved schema cleaning
- Refined signature caching logic (kept 1h TTL for memory efficiency)
- Enhanced Claude/Gemini translator tests
- Fixed Gemini function-calling INVALID_ARGUMENT via relaxed tool validation
2026-01-23 19:26:02 +07:00
hkfires ecc850bfb7 feat(executor): apply payload rules using requested model 2026-01-23 16:38:41 +08:00
hkfires 7ca045d8b9 fix(executor): adjust model-specific request payload 2026-01-22 20:28:08 +08:00
hkfires abfca6aab2 refactor(util): reorder gemini schema cleaner helpers 2026-01-22 18:38:48 +08:00
sowar1987 a2f8f59192 Fix Gemini function-calling INVALID_ARGUMENT by relaxing Gemini tool validation and cleaning schema 2026-01-22 17:11:07 +08:00
XYenon 8c7c446f33 fix(gemini): preserve displayName and description in models list
Previously GeminiModels handler unconditionally overwrote displayName
and description with the model name, losing the original values defined
in model definitions (e.g., 'Gemini 3 Pro Preview').

Now only set these fields as fallback when they are missing or empty.
2026-01-22 15:19:27 +08:00
RCD e86d2b86d5 feat: sync with upstream v6.7.16
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
2026-01-21 15:05:05 +07:00
hkfires 6dcbbf64c3 fix(executor): only strip maxOutputTokens for non-claude models 2026-01-21 10:49:20 +08:00
bexcodex 9f364441e8 Fix antigravity malformed_function_call 2026-01-20 19:54:54 +08:00
RCD e0fa10b669 feat: sync with upstream v6.7.13
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.
2026-01-20 14:08:05 +07:00
RCD 4a0f8232d5 refactor(claude): remove redundant system instructions check
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
2026-01-20 11:49:21 +07:00
RCD 02b0714e3a feat(vertex): add Imagen image generation model support
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
2026-01-20 11:31:07 +07:00
RCD e6e7e6db30 feat(registry): support provider-specific model info lookup
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
2026-01-20 11:15:39 +07:00
RCD 5dd078ffb3 refactor(claude): move max_tokens constraint enforcement to Apply method
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.
2026-01-20 10:53:37 +07:00