38 Commits
Author SHA1 Message Date
Copilot 7ff4825858 Sync upstream merge cleanup
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-24 19:23:19 +08:00
Copilot 69cd2a363a Merge upstream CLIProxyAPI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-24 18:44:14 +08:00
Luis Pater 78ba8ba731 chore: remove Gemini CLI-related translator packages and logic
- Deleted `geminicli` provider and related `Apply` logic.
- Removed all translator packages specific to Gemini CLI (Claude, Codex integrations).
- Purged associated test files for Gemini CLI translation.
- Removed `GeminiAuthenticator` and all associated authentication logic (OAuth flows, token handling, refresh logic).
- Deleted internal/executor Gemini OAuth support, including bearer token handling and runtime API logic.
- Purged all tests, configs, and command-line flags specific to Gemini OAuth flows.
- Updated documentation and aliases to reflect Gemini removal.
- Renamed `parseRetryDelay` to `ParseRetryDelay` and `deleteJSONField` to `DeleteJSONField`.
- Updated references in `antigravity_executor` and tests to use the new `helps` package.
- Adjusted import paths and test cases to ensure compatibility with the new location.
- Updated README files to reflect changes in the retry logic references.
- Updated `.github/ISSUE_TEMPLATE/bug_report.md` to remove deprecated Gemini CLI mention.
2026-06-18 13:33:10 +08:00
Luis Pater 9985976ebd feat(translator, pluginhost): add stream-specific response transformation support
- Introduced `HasStreamResponseTransformer` and `HasNonStreamResponseTransformer` to handle streaming and non-streaming transformations.
- Updated `executorResponseTranslatorExists` logic to correctly validate stream-specific transformers.
- Enhanced `TranslateStream` to suppress raw fallback when registered native transformers return empty output.
- Added comprehensive tests (`TestHasResponseTransformerChecksConcreteResponseKinds`, `TestHasResponseTransformerIgnoresEmptyRegistration`) for stream and non-stream transformer validation.
2026-06-11 10:16:58 +08:00
Luis Pater d625caddd9 feat(pluginhost): add capabilities for command-line flag handling and plugin execution
- Implemented command-line flag registration and execution for plugins with priority-based conflict resolution.
- Enabled plugin-owned command-line flag execution and persistence of plugin-auth data.
- Added new `Host` methods to support command-line capabilities, including flag normalization, validation, and execution state management.
- Introduced unit tests to ensure coverage for command-line plugin functionality, including auth data persistence.
- Updated configs to normalize plugins during initialization.
2026-06-06 18:35:17 +08:00
RCDandCopilot 18d9369ce4 chore: merge upstream CLIProxyAPI v7.0.1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 07:47:19 +00:00
Luis Pater e50cabac4b chore: upgrade CLIProxyAPI dependency to v7 across the project
- Updated all references from v6 to v7 for `github.com/router-for-me/CLIProxyAPI`.
- Ensured consistency in imports within core libraries, tests, and integration tests.
- Added missing tests for new features in Redis Protocol integration.
2026-05-08 11:46:46 +08:00
RCD a2a4fba626 chore: merge upstream CLIProxyAPI v6.9.1 2026-03-24 09:41:49 +07:00
Luis Pater 66ff916838 Merge pull request #2220 from xulongwu4/main
fix: normalize model name in TranslateRequest fallback to prevent prefix leak
2026-03-23 23:56:15 +08:00
Luis Pater 2bd646ad70 refactor: replace sjson.Set usage with sjson.SetBytes to optimize mutable JSON transformations 2026-03-19 17:58:54 +08:00
Longwu Ou 1e27990561 address PR review: log sjson error and add unit tests
- Log a warning instead of silently ignoring sjson.SetBytes errors in the TranslateRequest fallback path
  - Add registry_test.go with tests covering the fallback model normalization and verifying registered transforms take precedence
2026-03-18 12:43:40 -04:00
Longwu Ou e1e9fc43c1 fix: normalize model name in TranslateRequest fallback to prevent prefix leak
When no request translator is registered for a format pair (e.g.
        openai-response → openai-response), TranslateRequest returned the raw
        payload unchanged. This caused client-side model prefixes (e.g.
        "copilot/gpt-5-mini") to leak into upstream requests, resulting in
        "The requested model is not supported" errors from providers.

        The fallback path now updates the "model" field in the payload to
        match the resolved model name before returning.
2026-03-18 12:30:22 -04:00
RCD 0af0ad14e5 Merge upstream CLIProxyAPI v6.8.28–v6.8.32
Upstream changes:
- Codex responses compaction payload compatibility
- Codex usage_limit_reached retry-after, deterministic parsing
- Codex refresh_token_reused non-retryable fix
- Qwen rate limiting and quota error handling
- Context management compatibility simplification
- Antigravity tool_result image fix, model list backfill, deep copy cache
- Auth auto-refresh interval/concurrency limiting
- Auth hook OnResult refactor (replaces MarkResult)
- Gemini-3.1-flash-image support
- Registry cleanup of outdated model definitions

Fork resolution:
- Accept upstream's consolidated conductor.go (auto-refresh, round-tripper)
- Delete stale conductor_oauth.go, conductor_token.go (upstream reversed split)
- Delete stale provider_rotation_test.go (references removed method)
2026-02-27 20:58:16 +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>
2026-01-29 21:30:09 +07:00
Finessse 43f625caf1 chore: integrate sdk test files into main repo 2026-01-05 03:23:41 +07:00
Finessse 0f5836e14b refactor(translator): enhance registry with new capabilities
Update registry to support middleware, caching, pooling, and
resilience features integration.
2025-12-28 07:09:01 +07:00
Finessse 21125722cd test(translator): add lazy loading tests
Add tests for lazy translator registration and loading behavior.
2025-12-28 07:08:41 +07:00
Finessse 3e47344da9 feat(translator): add testing utilities
Add mock translators and test helpers for translator unit testing.
2025-12-28 07:08:31 +07:00
Finessse 31e52f26e8 feat(translator): add translation quality scoring
Add quality assessment for translations with structural comparison
and scoring metrics.
2025-12-28 07:08:21 +07:00
Finessse 3cf08319d4 feat(translator): add documentation generation
Add markdown docs, mermaid diagram, and summary generation for
registered translators.
2025-12-28 07:08:12 +07:00
Finessse b1a4bede65 feat(translator): add API helper functions
Add compatibility matrix, format listing, and translation info
query APIs for registry introspection.
2025-12-28 07:07:57 +07:00
Finessse 6cfd29ff1d feat(translator): add middleware pipeline support
Add pre/post translation middleware for payload transformation,
logging, and conditional processing.
2025-12-28 07:07:47 +07:00
Finessse 2874e52a2a feat(translator): add resilience and recovery strategies
Add translation recovery with direct hit, fallback chain, and
auto-detect strategies for robust format conversion.
2025-12-28 07:07:35 +07:00
Finessse 40c46acc08 feat(translator): add fallback chain support
Add multi-hop translation fallback chains for indirect format
conversions when direct translators are unavailable.
2025-12-28 07:07:24 +07:00
Finessse d8eb83c8fd feat(translator): add automatic format detection
Add payload format auto-detection for OpenAI, Claude, Gemini, and
Antigravity formats based on JSON structure analysis.
2025-12-28 07:07:14 +07:00
Finessse 5de9cfa8ea feat(translator): add translation benchmarking utilities
Add benchmark suite for measuring translation performance including
P50/P95/P99 latency percentiles and comparison tools.
2025-12-28 07:07:04 +07:00
Finessse 185dcc46dd feat(translator): add batch translation processing
Add batch processor for translating multiple payloads concurrently
with configurable worker count and progress callbacks.
2025-12-28 07:06:52 +07:00
Finessse 705039b410 feat(translator): add translator instance pooling
Add object pooling for translator instances to reduce allocation
overhead and improve concurrent translation performance.
2025-12-28 07:06:40 +07:00
Finessse 782e3f26a5 feat(translator): add translation result caching
Add LRU cache for translation results with configurable TTL and size.
Improves performance by avoiding redundant translations for identical
payloads.
2025-12-28 07:06:30 +07:00
Finessse 25e73af418 feat(translator): add request/response validation utilities
Add validation helpers for translator payloads including JSON schema
validation, required field checks, and format-specific validators.
2025-12-28 07:06:07 +07:00
FinessseandClaude Opus 4.5 b7a8424238 feat(translator): add Kiro format constant
Add FormatKiro constant to SDK translator formats.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:53:48 +07:00
Luis Pater 2d84d2fb6a **feat(auth, executor, cmd): add Antigravity provider integration**
- Implemented OAuth login flow for the Antigravity provider in `auth/antigravity.go`.
- Added `AntigravityExecutor` for handling requests and streaming via Antigravity APIs.
- Created `antigravity_login.go` command for triggering Antigravity authentication.
- Introduced OpenAI-to-Antigravity translation logic in `translator/antigravity/openai/chat-completions`.

**refactor(translator, executor): update Gemini CLI response translation and add Antigravity payload customization**

- Renamed Gemini CLI translation methods to align with response handling (`ConvertGeminiCliResponseToGemini` and `ConvertGeminiCliResponseToGeminiNonStream`).
- Updated `init.go` to reflect these method changes.
- Introduced `geminiToAntigravity` function to embed metadata (`model`, `userAgent`, `project`, etc.) into Antigravity payloads.
- Added random project, request, and session ID generators for enhanced tracking.
- Streamlined `buildRequest` to use `geminiToAntigravity` transformation before request execution.
2025-11-21 12:43:16 +08:00
Luis Pater 2f477df97e feat(translator): add built-in translator registry and helpers
- Introduced `builtin` package exposing a default registry and pipeline for built-in translators.
- Added format constants for common schemas (e.g., OpenAI, Gemini, Codex).
- Implemented helper functions for schema translation using format name strings.
- Provided example usage for integration with translator helpers.
2025-10-30 12:20:46 +08:00
Luis Pater f5dc380b63 rebuild branch 2025-09-25 10:32:48 +08:00
Luis Pater 3f69254f43 remove all 2025-09-25 10:31:02 +08:00
Luis Pater 48bbd9e214 fix(gemini): handle "[DONE]" chunk, trim "data:" prefix, and remove session_id from requests
- Adjusted stream handling to skip "[DONE]" chunks.
- Ensured "data:" prefix is trimmed for non-prefixed input in translation.
- Removed `session_id` from request bodies before processing.
2025-09-24 23:34:46 +08:00
Luis Pater 3dd5095792 feat(translators): add token counting support for Claude and Gemini responses
- Implemented `TokenCount` transform method across translators to calculate token usage.
- Integrated token counting logic into executor pipelines for Claude, Gemini, and CLI translators.
- Added corresponding API endpoints and handlers (`/messages/count_tokens`) for token usage retrieval.
- Enhanced translation registry to support `TokenCount` functionality alongside existing response types.
2025-09-24 11:59:38 +08:00
Luis Pater 4999fce7f4 v6 version first commit 2025-09-22 01:40:24 +08:00