Commit Graph
2612 Commits
Author SHA1 Message Date
Villoh 1074507a2f docs: add Tunnel Agent to community projects 2026-06-03 18:34:56 +02:00
Luis Pater 55440f0a39 feat(auth): add runtime auth removal and unscheduling logic
- Introduced `Manager.Remove` to delete runtime auth and unschedule associated tasks.
- Updated handler logic to directly remove auth instead of marking as disabled.
- Added tests to validate removal, unscheduling, and runtime state handling.
- Added a test to validate `skipPersist` behavior during registration.
- Enhanced `Remove` test to verify auto-refresh loop state before and after removal.

Closes: #3690
2026-06-03 11:56:56 +08:00
Luis Pater 9c02454005 Merge pull request #3657 from catoncat/fix/responses-input-id-dedupe-orphaned-output
fix(openai): keep referenced tool call when deduping websocket input IDs
2026-06-03 11:22:00 +08:00
Luis Pater 1c9601ff32 Merge pull request #3689 from sususu98/pr/cloudflare-challenge-retry
fix(auth): retry and backoff cloudflare challenge 403 errors
2026-06-03 11:07:08 +08:00
sususu98 77061aad4b refactor(auth): simplify and narrow cloudflare challenge checks 2026-06-03 10:35:39 +08:00
sususu98andClaude Opus 4.8 45f58d4f91 fix(auth): retry and backoff cloudflare challenge 403 errors
Introduce Cloudflare challenge detection for 403 errors in the Auth
Manager. Apply a progressive rate-limiting cooldown ladder using the
existing BackoffLevel field instead of a hard 30-minute credentials
suspension. This ensures challenged requests fall through to subsequent
credentials and recover exponentially.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-03 10:28:43 +08:00
sususu98 7682accd95 Merge pull request #3688 from sususu98/fix-codex-replay-dev
fix(codex): avoid replaying orphan tool calls
2026-06-03 09:59:44 +08:00
sususu98 17af089189 fix(codex): avoid replaying orphan tool calls 2026-06-03 09:52:17 +08:00
Luis Pater 35ab084fc3 refactor(runtime): enhance NewUtlsHTTPClient with context-based RoundTripper
- Updated `NewUtlsHTTPClient` to support context-aware RoundTrippers for protected hosts (e.g., Cloudflare bypass).
- Replaced `anthropicHosts` with `utlsProtectedHosts` to generalize host handling logic.
- Added unit test to validate context-based RoundTripper behavior.
- Replaced `NewProxyAwareHTTPClient` with `NewUtlsHTTPClient` in relevant executors for improved TLS fingerprinting.

Closes: #3680
2026-06-03 06:58:26 +08:00
Luis Pater 0e3c809ceb fix(codex): handle non-empty reasoning and content items, add test for trailing empty messages
Closes: #3683
2026-06-03 06:28:51 +08:00
Luis Pater 28c7f41cba docs(readme): update project descriptions and add Panopticon link
- Updated links and descriptions for `CPA-Manager-Plus`, replacing outdated `CPA-Manager` references.
- Added `Panopticon`, a multi-agent orchestration tool, to the project list.
2026-06-02 19:42:51 +08:00
Luis Pater d710248407 Merge pull request #3676 from eltmon/add-panopticon-to-users
docs: add Panopticon to "Who is with us?"
2026-06-02 19:35:57 +08:00
Luis Pater 02d0d92a8e Merge pull request #3677 from sususu98/codex/home-auth-loop-upstream-dev
Fix Home auth refresh retry handling
2026-06-02 19:30:14 +08:00
Luis Pater 8306391f91 Merge pull request #3667 from sususu98/feat/codex-reasoning-replay-cache-upstream-dev
feat(codex): cache reasoning replay items
2026-06-02 19:28:55 +08:00
sususu98 4abd59ce1b Merge pull request #3679 from sususu98/codex/system-role-to-user-upstream-dev
fix(translator): normalize message-level system roles for Gemini
2026-06-02 16:56:27 +08:00
sususu98 68282c4aa7 fix(translator): normalize message-level system roles for Gemini 2026-06-02 16:48:58 +08:00
sususu98 603a08fc1a feat(codex): cache reasoning replay items 2026-06-02 16:08:40 +08:00
sususu98 c9dc6bd628 Fix Home auth refresh retry handling
Parse Home refresh auth envelopes so refreshed access tokens are used instead of returning missing access token.

Stop retrying when Home dispatch returns an auth that already failed within the same request.
2026-06-02 13:43:07 +08:00
Edward Becker 7cb466a8e6 docs: add Panopticon to "Who is with us?" 2026-06-02 01:11:03 -04:00
Luis Pater 87d813c56c chore(models): remove legacy GPT 5.2 and GPT 5.3 Codex entries from registry
- Cleaned up outdated GPT 5.2 and GPT 5.3 Codex model configurations from `models.json`.
- Simplified registry by removing unused model references across all tiers (`codex-team`, `codex-plus`, `codex-pro`).
2026-06-02 10:41:12 +08:00
Luis Pater bf04a24221 feat(models): add support for grok-composer-2.5-fast model
- Introduced `grok-composer-2.5-fast` as a new XAI model.
- Updated registry to include display name, description, and configuration details for the new model.
- Enabled support for the model in the Responses API.
2026-06-02 08:50:32 +08:00
Luis Pater f353979e0a feat(watcher, redisqueue): add usage refresh notification support
- Introduced `NotifyUsageRefresh` in `redisqueue` to notify subscribers of usage refresh events.
- Enhanced `Watcher` logic to trigger usage refresh notifications on client changes (add/update/remove).
- Updated tests to validate proper broadcast of usage refresh messages to subscribers.
- Added support for initial `support_refresh` payload upon subscription initialization.
2026-06-02 02:52:27 +08:00
Luis Pater 959067edfb feat(usage): introduce executor type tracking in usage reporting
- Replaced `NewUsageReporter` with `NewExecutorUsageReporter` to include executor type in usage records.
- Updated all executors to use the new reporter implementation.
- Extended `UsageReporter` to track and publish executor type.
- Added tests to validate proper executor type recording and handling.
- Enhanced RedisQueue plugin and payload schema with executor type support.
2026-06-02 00:43:16 +08:00
cat f05d68d4ec refactor(openai): parse dedupe input item metadata in a single pass
Address review feedback: parse each item's type/id/call_id once with
gjson.GetManyBytes and reuse it across the dedupe loops instead of
rescanning every item up to five times. Behavior is unchanged.
2026-06-01 15:01:31 +08:00
cat e7f4dd470d fix(openai): keep referenced tool call when deduping websocket input IDs
The input item ID dedupe added in #3620 keeps only the last occurrence of
each item id. When an upstream reuses the same item id across a re-sent or
repaired tool call (so two function_call items share an id but carry
different call_ids), the last-wins rule can drop the function_call whose
call_id still has a matching function_call_output. The upstream then rejects
the request with HTTP 400 "No tool call found for function call output with
call_id ...", breaking every subsequent turn over the Codex WebSocket path.

Make the dedupe orphan-aware: when several input items share an id, never
replace an item whose call_id is still referenced by a tool-call output with
one that is not. This keeps a single item per id (preserving the original
intent) while ensuring retained tool calls stay paired with their outputs.

Adds a regression test covering two function_call items that share an id
where only the earlier call_id has a surviving output.
2026-06-01 13:10:41 +08:00
Luis Pater 05b972479a feat(executor): refine session and conversation header handling for Codex
- Updated session handling to replace `Session_id` and `Conversation_id` headers with new logic ensuring consistent use of `Cache.ID` and prompt keys.
- Restored `Session_id` as a priority extraction source for `ExtractSessionID`.
- Added tests to validate case-sensitive and case-insensitive headers, canonical account header usage, and session key preservation.
- Removed legacy support for deprecated `Conversation_id` header to clean up API.
2026-06-01 11:27:10 +08:00
Luis Pater fb4f39d300 test(models, executor): add XAI video model test and fix Codex User-Agent assertions 2026-06-01 02:59:31 +08:00
Luis Pater ac1360f479 feat(models): add support for grok-imagine-video-1.5-preview model
- Introduced `grok-imagine-video-1.5-preview` as a new XAI video model.
- Updated handlers, registry, and validation logic to include support for the new model.
- Enhanced test coverage to validate integration and functionality of the preview model.
2026-06-01 02:56:15 +08:00
Luis Pater bbcdaab79d feat(executor): enhance Codex identity obfuscation with turn and window metadata handling
- Modified `applyCodexIdentityConfuse*` functions to include `turn_id` and `window_id` in metadata transformations.
- Updated test cases to validate the inclusion and restoration of these fields.
- Removed deprecated `Conversation_id` header support and related logic for cleaner implementation.
2026-06-01 00:50:46 +08:00
Luis Pater 0f24cafbdd feat(executor): implement identity obfuscation for Codex requests and responses
- Added `applyCodexIdentityConfuse*` functions for remapping request and response payloads and headers to enhance security.
- Updated WebSocket and HTTP logic to handle identity state transformations seamlessly.
- Introduced unit tests to verify remapping and restoration of identity-related fields.
2026-05-31 23:31:35 +08:00
Luis Pater 33983b6f3e refactor(executor): consolidate Codex request translation logic
- Introduced `translateCodexRequestPair` to simplify and reuse translation logic for handling original and modified payloads.
- Updated relevant methods to use the new function.
- Added unit tests to cover payload reuse and differentiation scenarios.
2026-05-31 14:38:54 +08:00
Luis Pater 3a54fb7fcf Merge branch 'dev', commit 'refs/pull/3621/head' of github.com:router-for-me/CLIProxyAPI into dev
# Conflicts:
#	internal/translator/gemini/openai/responses/gemini_openai-responses_request_test.go
2026-05-30 20:57:14 +08:00
Luis Pater 430e679e2a fix(auth): strip "generate" from payload during WebSocket HTTP fallback
- Added `sanitizeDownstreamWebsocketFallbackRequest` to clean `generate` from payload for HTTP fallback requests.
- Implemented tests to validate payload handling logic in WebSocket-to-HTTP transitions.

Closes: #3556
2026-05-30 05:14:05 +08:00
Luis Pater 55901f0bda Merge pull request #3620 from iBenzene/fix/responses-input-id-dedupe
fix(openai): dedupe response websocket input item IDs
2026-05-30 03:27:36 +08:00
zzmc 776a9c0049 fix(translator/gemini): support developer role in OpenAI Responses requests 2026-05-29 09:24:48 -07:00
Luis Pater fc0615b171 test(oauth): ensure missing auth directories are created and callback payloads are validated
Closes: #3619
2026-05-29 23:04:35 +08:00
Luis Pater 96b6f7e217 Merge pull request #3612 from router-for-me/log
feat(logging): add request_id handling in HomeAppLogForwarder and tests
2026-05-29 22:10:12 +08:00
Luis Pater 034d2b6bf8 Merge pull request #3615 from sususu98/codex/signature-intercept-on-pr
feat: intercept incompatible signature replay
2026-05-29 22:09:10 +08:00
iBenzene e9dafc7093 fix(openai): dedupe response websocket input item IDs 2026-05-29 17:06:48 +08:00
sususu98 aee7a5fbc5 feat: intercept incompatible signature replay 2026-05-29 15:22:57 +08:00
sususu98 86cb9c150b feat(signature): upgrade provider signature checks 2026-05-29 12:24:18 +08:00
Luis Pater 7d9980e8fa fix(logging): log errors during file-backed source cleanup 2026-05-29 11:24:58 +08:00
hkfires d2c5f279f6 feat(logging): add request_id handling in HomeAppLogForwarder and tests 2026-05-29 10:58:19 +08:00
Luis Pater 4ade13a374 Merge pull request #3605 from router-for-me/log
feat(logging): add HomeAppLogForwarder for application log forwarding
2026-05-29 08:38:40 +08:00
hkfires c4ee063b95 feat(logging): add HomeAppLogForwarder for application log forwarding 2026-05-29 08:12:52 +08:00
Luis Pater f28258de22 Merge pull request #3595 from Progress-infinitely/fix/anthropic-tool-name-reverse-map
fix(amp): restore response tool casing from request
2026-05-29 02:17:27 +08:00
Luis Pater df0176a188 feat(models): add Claude Opus 4.8 model to registry 2026-05-29 01:22:46 +08:00
Luis Pater c65275fd32 Merge pull request #3591 from sususu98/feat/signature-check-extraction
refactor: extract signature validation
2026-05-28 22:17:52 +08:00
Luis Pater 71c185f614 feat(usage): add service tier tracking and defaults in usage reporting
- Introduced `service_tier` metadata key to capture client-requested service tiers.
- Updated usage records, context propagation, and plugins to include service tier data.
- Added default handling logic for cases where `service_tier` is absent.
- Implemented tests for `service_tier` extraction, defaults, and updates across components.
2026-05-28 22:15:54 +08:00
Luis Pater 65e760aa1a feat(usage): include cache tokens in total token calculation and add tests
- Updated `TotalTokens` calculation to account for `CacheReadTokens` and `CacheCreationTokens`.
- Added tests to validate accurate token aggregation and fallback behavior for `CachedTokens`.
2026-05-28 21:34:54 +08:00