Commit Graph
1975 Commits
Author SHA1 Message Date
RCDandClaude 0801d1d101 fix(config): add codex instructions enabled change to config change details
Cherry-picked from upstream bb09708c

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:35:49 +07:00
RCDandClaude 993e6795c0 fix(misc): update opencode instructions
Cherry-picked from upstream 1150d972

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:35:26 +07:00
RCDandClaude 4ba0a04c37 feat(logging): make error-logs-max-files configurable
Cherry-picked from upstream 6db8d2a2

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:34:58 +07:00
RCDandClaude 006bd54c9a fix(misc): update user agent string for opencode
Cherry-picked from upstream 2854e04b

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:34:19 +07:00
RCDandClaude af48e0f37b fix(translator): handle stop_reason and MAX_TOKENS for Claude responses
Cherry-picked from upstream f99cddf9

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:33:36 +07:00
RCDandClaude 2f6fee08d4 fix(translator): include token usage in message_delta for Claude responses
Cherry-picked from upstream 550da0ce

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:33:20 +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 d9b3f07db3 feat(auth): add custom HTTP client with utls for Claude API authentication
Cherry-picked from upstream 6b6d030e

Adds uTLS-based HTTP transport to mimic browser TLS fingerprints for Claude API.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:32:40 +07:00
RCDandClaude 4a3996ca5c feat(translator): add code_execution and url_context tool passthrough
Cherry-picked from upstream 538039f5

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:31:18 +07:00
RCDandClaude 459997789e refactor(gemini): optimize removeExtensionFields with post-order traversal
Cherry-picked from upstream ca796510

Uses post-order traversal and DeleteBytes for better performance.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:30:57 +07:00
RCDandClaude 29f0da4942 fix(gemini): remove unsupported extension fields
Cherry-picked from upstream d0d66cdc

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:30:35 +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 a7fa518584 fix: skip empty text parts and messages for Gemini API
Cherry-picked from upstream 2666708c

When Claude API sends an assistant message with empty text content,
the translator was creating an empty part, causing Gemini API to return
"required oneof field 'data' must have one initialized field" error.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:29:47 +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
RCDandClaude 1c9ade20f8 fix: change HTTP status code from 400 to 502 when no provider available
Cherry-picked from upstream 6da7ed53

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:28:20 +07:00
RCDandClaude 787af1fb12 fix(antigravity): preserve finish_reason tool_calls across streaming chunks
Cherry-picked from upstream fe6043ae

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:28:03 +07:00
RCDandClaude 070ddb0ff5 fix: prevent race condition in objectstore auth sync
Cherry-picked from upstream bc32096e

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:27:40 +07:00
RCDandClaude ae7946402a fix(translator): validate complete JSON before using SetRaw for tool output
Tool outputs like "[1,2,3]\n\n[Process exited with code 0]" were being
partially parsed by gjson.Parse() which would extract just "[1,2,3]" and
lose the trailing text. This caused invalid JSON in the Gemini request.

Fix: Use gjson.Valid() to verify the ENTIRE string is valid JSON before
treating it as raw JSON. If validation fails, treat as a string with
proper escaping via sjson.Set().

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
v0.3.0-dev-0.25
2026-01-30 17:19:56 +07:00
RCDandClaude a7b7856135 fix(tests): register test models in global registry for auth lookup
Tests were failing with "auth_not_found: no auth available" because the
conductor.pickNextMixed() function checks ClientSupportsModel() against
the global registry. Test auths weren't registered with their models.

Changes:
- sdk/cliproxy/auth/conductor_test.go: Add registry.RegisterClient calls
- internal/translator/gemini/.../gemini_openai-responses_request.go:
  Skip empty text parts to avoid invalid Gemini content

Note: Some pre-existing flaky tests remain in test/integration and
internal/translator/gemini (NonJSON tool output test).

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
v0.3.0-dev-0.24
2026-01-30 16:07:03 +07:00
RCDandClaude c73b709a98 feat(registry): sync model definitions from plus remote
- Add SupportedEndpoints field to ModelInfo
- Add GetMiniMaxModels, GetZhipuModels stub functions
- Add GetGitHubCopilotModels, GetKiroModels, GetAmazonQModels
- Update model registry with new providers

Cherry-picked and merged from plus remote.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
v0.3.0-dev-0.23
2026-01-30 15:44:20 +07:00
RCDandClaude 63e54f2ca4 chore(registry): disable gemini 2.5 flash image preview model
Cherry-picked from plus: 88a0f095

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:41:28 +07:00
RCDandClaude ac2d6df45e chore(registry): comment out rev19-uic3-1p model config
Cherry-picked from plus: c65f64dc

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:41:06 +07:00
RCDandClaude 6756600812 feat(api): add management model definitions endpoint
Cherry-picked from plus: d18cd217

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:40:44 +07:00
RCDandClaude 3a00e35a5a feat(auth): add support for request_retry and disable_cooling overrides
Cherry-picked from plus: 70897247

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:39:42 +07:00
RCDandClaude cb25c754ea feat(auth): add skip persistence context key for file watcher events
Cherry-picked from plus: 9c341f5a

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:39:20 +07:00
RCDandClaude a8592c8410 fix(claude): default Claude tool input schema
Cherry-picked from plus: e3e741d0

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:38:36 +07:00
RCDandClaude 9e53fc4540 fix(kiro): fix Kiro tool schema defaults
Cherry-picked from plus: 7c7c5fd9

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:38:17 +07:00
RCDandClaude e17990c2f8 fix(config): ensure empty mapping persists for oauth-model-alias deletions
When all oauth-model-alias entries are deleted, ensure an empty map
is persisted to config file rather than being omitted entirely.

Fixes #1305

Cherry-picked from upstream: a709e5a1

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
v0.3.0-dev-0.22
2026-01-30 15:31:58 +07:00
RCDandClaude 71a502075e fix(logging): capture streaming TTFB on first chunk and make timestamps required
- Add firstChunkTimestamp field to ResponseWriterWrapper for sync capture
- Capture TTFB in Write() and WriteString() before async channel send
- Add SetFirstChunkTimestamp() to StreamingLogWriter interface
- Make requestTimestamp/apiResponseTimestamp required in LogRequest()
- Remove timestamp capture from WriteAPIResponse() (now via setter)
- Fix Gemini handler to set API_RESPONSE_TIMESTAMP before writing response

This ensures accurate TTFB measurement for all streaming API formats
(OpenAI, Gemini, Claude) by capturing timestamp synchronously when
the first response chunk arrives, not when the stream finalizes.

Cherry-picked from upstream: 295f34d7

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:31:30 +07:00
RCDandClaude bcd735b2a8 fix(logging): add API response timestamp and fix request timestamp timing
Previously:
- REQUEST INFO timestamp was captured at log write time (not request arrival)
- API RESPONSE had NO timestamp at all

This fix:
- Captures REQUEST INFO timestamp when request first arrives
- Adds API RESPONSE timestamp when upstream response arrives
- Add Timestamp field to RequestInfo, set at middleware initialization
- Set API_RESPONSE_TIMESTAMP in appendAPIResponse() and gemini handler
- Pass timestamps through logging chain to writeNonStreamingLog()
- Add timestamp output to API RESPONSE section

Cherry-picked from upstream: c41ce77e

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:30:56 +07:00
RCDandClaude 584648416a fix(translator): restore usageMetadata in Gemini responses from Antigravity
When using Gemini API format with Antigravity backend, the executor
renames usageMetadata to cpaUsageMetadata in non-terminal chunks.
The Gemini translator was returning this internal field name directly
to clients instead of the standard usageMetadata field.

Add restoreUsageMetadata() to rename cpaUsageMetadata back to
usageMetadata before returning responses to clients.

Cherry-picked from upstream: 9dc0e6d0

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:29:30 +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>
v0.3.0-dev-0.21
2026-01-29 21:30:09 +07:00
RCDandClaude 7d1dc22657 feat(config): add AmpCode config and incognito browser option
- Add AmpCode configuration structure for Amp CLI proxy
- Add IncognitoBrowser option for OAuth flows
- Update SDK config mappings

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:29:39 +07:00
RCDandClaude 6b85dadce7 feat(interfaces): extend client models and types
Update interfaces with new fields for extended provider support.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:29:29 +07:00
RCDandClaude 24626d061d feat(constant): add Kiro and iFlow provider constants
Add new provider constants for Kiro and iFlow authentication.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:29:20 +07:00
RCDandClaude 3fc5b5a3b3 feat(auth): add empty token provider for unauthenticated requests
Add empty auth provider for handling requests that don't require authentication.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:23:46 +07:00
RCDandClaude 357eed3ec6 feat(auth): enhance Kiro authentication with rate limiting and metrics
Extend Kiro auth module with:
- Background token refresh
- Cooldown mechanism for failed requests
- Browser fingerprint generation
- Jitter utilities for request timing
- Metrics collection and reporting
- Rate limiter with singleton pattern
- Refresh manager for token lifecycle
- Token repository for persistent storage
- Usage checker for quota monitoring
- Web-based OAuth flow templates
- Updated AWS auth and SSO OIDC flows

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:23:31 +07:00
RCDandClaude d6104a0fca feat(auth): add iFlow authentication provider
Add iFlow auth module for cookie-based authentication:
- Cookie helper utilities
- iFlow auth client implementation
- Token management
- Local OAuth server for browser flow
- SDK auth integration

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:23:10 +07:00
RCDandClaude 45ba3b9c3f feat(auth): add GitHub Copilot OAuth authentication
Add complete Copilot authentication module:
- OAuth device flow for GitHub authentication
- Token management and storage
- Error handling for auth failures

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:22:38 +07:00
RCDandClaude 92bf72d8c5 feat(amp): add Amp CLI proxy module
Add complete Amp module for routing requests through the Amp CLI:
- Core module with lifecycle management
- Gemini bridge for model translation
- Model mapping configuration
- Proxy handler for request forwarding
- Response rewriter for format conversion
- Secret management for API keys
- Route definitions and fallback handlers
- Comprehensive test coverage

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:22:19 +07:00
RCDandClaude 1fa155621b feat: sync with upstream v6.7.28
Cherry-picked changes from CLIProxyAPI v6.7.28:

- feat(handlers): add test to verify no retries after partial stream response (4eb1e60)
- fix(config): prune oauth-model-alias when preserving config (d0bada7)

Note: fix(api): update amp module only on config changes (8510fc3) was skipped
as ProxyPilot does not have the Amp feature.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 18:48:10 +07: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.
v0.3.0-dev-0.20
2026-01-27 22:08:43 +07: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
v0.3.0-dev-0.19
2026-01-26 20:22:43 +07: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
v0.3.0-dev-0.18
2026-01-24 11:17:03 +07: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
v0.3.0-dev-0.17
2026-01-23 19:26:02 +07: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
v0.3.0-dev-0.16
2026-01-21 15:05:05 +07:00
RCD 3fb213d513 feat: sync with upstream v6.7.15
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
v0.3.0-dev-0.15
2026-01-20 16:49:13 +07: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.
v0.3.0-dev-0.14
2026-01-20 14:08:05 +07:00