Commit Graph

4070 Commits

Author SHA1 Message Date
Luis Pater
fc2c98d1ca feat(runtime): enhance Devin model aggregation and UID normalization
- Implement `splitDevinUID` for consistent UID splitting and effort extraction.
- Update model aggregation to handle thinking levels and merge variants.
- Refine display name cleaning logic to remove redundant suffixes.
- Adjust Devin catalog integration to exclude exposed thinking variants.
- Normalize and sort thinking levels with an extended rank scheme.

Closes: #6141
2026-09-27 02:03:55 +08:00
Luis Pater
be4b28f165 feat(codex): support service tier in OpenAI request translation
- Parse and normalize `service_tier` from incoming OpenAI chat completion requests
- Map `fast` and `priority` to `priority`, and preserve `ultrafast`
- Omit absent, default, or unsupported service tier values

Closes: #6138
2026-09-26 23:22:17 +08:00
Luis Pater
3b2882b72e fix(codex): strip non-standard multi-agent metadata for compat models
- Pass compat mode flag to multi-agent v2 input rewriting
- Proactively remove `author`, `recipient`, and internal passthrough metadata for compat models
- Allow stripping non-standard metadata even when multi-agent v2 optimization is disabled

Closes: #6136
2026-09-26 22:51:47 +08:00
Luis Pater
6cd86fb272 feat(auth): support terminal rejection in plugin scheduler
- Add reject flags and reason fields to `SchedulerPickResponse` with snake_case JSON unmarshaling support
- Terminate candidate selection with an auth error when scheduler rejection is flagged
- Normalize rejection response with default error code and reason in the plugin host

Closes: #6130
2026-09-26 21:50:02 +08:00
Luis Pater
3de5709db1 fix(claude): preserve tool result adjacency for Antigravity requests
- Split function response parts from mixed user turns in Gemini payloads
- Hoist function response turns ahead of intervening text reminders following model calls
- Apply function response turn splitting and adjacent user turn merging for Claude models

Closes: #6129
2026-09-26 21:22:41 +08:00
Luis Pater
b4e5cc019d fix(thinking): log effective effort and baseline for native Responses requests
- Use Codex usage config extraction to log the effective thinking effort
- Include baseline level in logged fields when the top-level mode is configured
- Guard config extraction and logging behind a debug log level check
2026-09-26 15:27:51 +08:00
Luis Pater
12245ad388 fix(thinking): log baseline configuration for native Responses requests
- Handle unchanged native Responses payloads before user-defined model processing
- Extract and log original and processed thinking configuration when present
- Return payload unmodified without rewriting or re-validating
2026-09-26 14:17:20 +08:00
Luis Pater
ed980be34b fix(auth): preserve resolved model capabilities and configuration update support
- Attach resolved execution model info during execution and token counting even when restoring execution models
- Propagate configuration update support to resolved Home dispatch model info
- Track modifications to configuration updates across plugin normalizers in the translation pipeline
- Mark configuration update support for eligible Codex models in the registry
v7.3.18
2026-09-26 13:57:06 +08:00
sususu98
960be012c2 fix(auth): unschedule disabled invalid_grant credentials and apply exponential backoff for enabled invalid_grant (#6123)
- Permanently unschedule credentials that are disabled and encounter invalid_grant to avoid high-frequency refresh loops.
- Preserve expected token refresh behavior for normal disabled credentials without invalid_grant failures.
- Apply exponential backoff starting at 1m up to 30m when enabled credentials encounter invalid_grant to allow CAPTCHA/checkpoint recovery.
- Add regression tests covering disabled invalid_grant unscheduling and exponential backoff retry cycles.
2026-09-25 18:12:49 +08:00
Luis Pater
4332048dda fix(claude): apply cloaking by default for direct Messages OAuth requests
- Remove direct Messages passthrough bypass for unconfirmed OAuth credentials
- Ensure standard cache control handling and CLI fingerprinting apply upstream
- Support detection for Claude Code 2.1.280 title helper payload shape

Closes: #6120
2026-09-25 12:38:18 +08:00
sususu
58461c8f47 fix(auth): unschedule disabled invalid_grant credentials and apply exponential backoff for enabled invalid_grant
- Permanently unschedule credentials that are disabled and encounter invalid_grant to avoid high-frequency refresh loops.
- Preserve expected token refresh behavior for normal disabled credentials without invalid_grant failures.
- Apply exponential backoff starting at 1m up to 30m when enabled credentials encounter invalid_grant to allow CAPTCHA/checkpoint recovery.
- Add regression tests covering disabled invalid_grant unscheduling and exponential backoff retry cycles.
2026-09-25 12:03:43 +08:00
Luis Pater
5530cbd2a5 fix(auth): preserve attributes and path across plugin refreshes
- Merge existing auth attributes and preserve file path metadata across plugin refreshes
- Avoid overwriting existing source and path attributes during auth data conversion
- Retry file stat during atomic replace to prevent premature removal of known auth files

Closes: #6119
2026-09-25 11:55:21 +08:00
Luis Pater
60325f472a fix(devin): ensure swe-1-6-slow is preserved as a builtin model
- Add static and builtin model definition for `devin/swe-1-6-slow`
- Inject builtin models into Devin catalog retrieval, lookup, and dynamic updates

Closes: #6111
2026-09-25 03:32:53 +08:00
Luis Pater
9bdde54b59 fix(meta): fix client id header and preserve subscription metadata
- Fix malformed `X-Client-Id` header and ensure it is applied to upstream requests
- Preserve subscription metadata during OAuth token creation and token refreshes
- Support dynamic retry-after for 404 responses and shorten default Meta 404 cooldown

Closes: #6117
v7.3.17
2026-09-25 03:05:24 +08:00
Luis Pater
1dffddf4ac fix(session): avoid rescanning large payloads during session extraction
- Introduce `sessionObject` to index top-level JSON fields once for session key lookups
- Prevent repeated rescans of large message payloads when probing missing candidate keys
- Support duplicate top-level keys when resolving nested paths

Closes: #6114
2026-09-25 02:06:50 +08:00
Luis Pater
c9a06ba6f2 fix(interceptors): avoid cloning request body for read-only interceptors
- Share request payload reference during session identity enrichment when original request is unset
- Avoid cloning request payload when interceptors do not mutate the body
- Pass request body directly to handler and conductor interceptors

Closes: #6101
2026-09-25 00:34:17 +08:00
Luis Pater
74c1ebd37f fix(registry): keep request context active until response body is read
- Postpone request context cancellation until after reading and closing the response body
- Ensure response body is closed and context is canceled across all error paths

Closes: #6095
2026-09-24 23:50:30 +08:00
Luis Pater
759c57c261 fix(api): immediately close connections on stop and guard state access
- Switch HTTP server stop from graceful shutdown to immediate close to prevent hanging on active requests
- Guard listeners and configuration access with dedicated mutexes
- Instantiate service shutdown context with a fresh timeout deadline upon exit

Closes: #6094
2026-09-24 23:31:51 +08:00
sususu
377747b8b6 fix(registry,cliproxy): set xai owned_by for Devin grok models and align Antigravity web search tests
- Map Devin grok models to xai owned_by in catalog and fetch_devin_models tool
- Update Antigravity fetched capability test to reflect gemini-pro-agent native web search support
- Fix formatting in test fixtures
2026-09-24 22:23:18 +08:00
sususu
c7f358d4d4 fix(executor,auth): support Session_id header in Antigravity replay and remove redundant stream chunk logging 2026-09-24 20:54:05 +08:00
Chén Mù
75f2d018cc Merge pull request #6107 from sususu98/fix/stream-rewrite-log-noise
fix(auth,translator): reduce stream model rewrite log noise and prevent empty parts on unsigned text
2026-09-24 19:14:50 +08:00
sususu
107d7f76c9 fix(translator,auth): avoid synthetic bypass on unsigned text parts and reduce stream rewrite log noise
- In gemini_openai-responses_request.go, do not attach 'skip_thought_signature_validator' to visibleText or thought parts when there is no genuine signature to replay.
- In response_model_rewriter.go, track rewritten model paths per stream to emit a single start debug log and a final summary upon stream completion, avoiding hot-path per-chunk log flooding.
2026-09-24 18:59:13 +08:00
Chén Mù
8222e328c0 Enhance logging and improve thought signature handling (#6106)
* fix(gemini): suppress repeated thoughtSignature sanitizations and improve logging

* fix(executor): enhance logging for antigravity replay context hash rejections and clean up request struct formatting

* fix(executor): enhance context hash rejection logging and improve request index handling
fix(signature): distinguish detected providers in thought signature sanitization logs
fix(translator): update thought signature handling in OpenAI responses conversion
2026-09-24 18:55:40 +08:00
sususu
75b854eb2e fix(translator): sanitize tool names for Claude and inject fallback schema for parameterless tools 2026-09-24 15:44:07 +08:00
sususu98
f7c738dad3 fix(claude): align 2.1.280 fingerprint and thinking visibility (#6096)
* fix(claude): align Opus 5.5 cloak and preserve native CLI hints

* fix(claude): recognize the 2.1.280 Haiku title helper

The native title request now appends server-side fallback, fallback credit,
and cache diagnosis after the structured-output beta. Keep the helper
allowlist exact so this sequence passes through without cloaking.

* fix(claude): align thinking visibility and Messages passthrough

* fix(claude): preserve thinking visibility through compatibility paths

* fix(claude): harden OAuth beta, session alignment, and 2.1.280 helper headers
2026-09-24 15:26:39 +08:00
Luis Pater
dd3b657b5d fix(codex): use resolved base model for routing hint
- Pass resolved `baseModel` directly to `applyCodexRoutingHint` instead of reading model from the upstream body
- Ensure the routing hint header accurately reflects the resolved model across HTTP and WebSocket executions
2026-09-24 13:02:16 +08:00
Luis Pater
0876e7f043 Merge commit 'refs/pull/6090/head' of github.com:router-for-me/CLIProxyAPI into dev 2026-09-24 12:49:55 +08:00
Luis Pater
93cccc6b28 Merge pull request #6092 from router-for-me/xai
Enhance XAI response sanitization and reasoning support
2026-09-24 12:31:07 +08:00
hkfires
6d1d74b30d refactor(executor): remove unsupported reasoning effort handling and update related tests 2026-09-24 09:02:02 +08:00
SamGu-NRX
b97f71da0c fix(codex): send the ChatGPT routing hint native Codex sends
- Send X-Codex-Routing-Hint ("model=<slug>" plus ";tier=<service_tier>")
  on ChatGPT-backend requests over HTTP, compact and websocket handshakes,
  matching openai/codex rust-v0.155.0 build_routing_hint_header. Translated
  requests previously carried service_tier=priority only in the body.
- Derive the hint from the final upstream body, replacing a hint a native
  client forwarded, so it names the model and tier actually sent.
- Keep operator precedence: an auth header rule that resolves to a value
  wins, a dynamic rule that resolves to nothing falls back to the derived
  hint, and models.json override_header still applies last.
- Leave API-key requests unchanged, and keep websocket reuse as native Codex
  does: an open connection keeps its handshake hint when the tier changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 19:56:53 -05:00
hkfires
984aee8df0 feat(executor): enhance sanitizeXAIResponsesBody to utilize resolved thinking support 2026-09-24 08:50:29 +08:00
Luis Pater
c404af96eb fix(auth): preserve file priority across plugin auth refreshes
- Introduce `AttributeFilePriority` and helper to track priority inherited from auth files
- Preserve file-configured priority attributes and metadata in plugin host during auth refresh
- Apply file priority metadata consistently across synthesizer, token filestore, and management handlers

Closes: #6089
v7.3.16
2026-09-24 08:09:21 +08:00
Luis Pater
781a203b99 fix(claude): merge adjacent text blocks into single assistant message
- Keep adjacent text content blocks in the same assistant message during streaming translation
- Reuse active message output item across consecutive text blocks in non-streaming translation

Closes: #6088
2026-09-24 06:45:11 +08:00
Luis Pater
7d888bf3ca feat(auth): persist meta mint subscription metadata in auth record
- Save subscription tier name, tier ID, subscription status, and payment method flag to metadata when minting key

Closes: #6086
2026-09-24 06:23:35 +08:00
Luis Pater
855a722349 feat(pluginhost): add host http operation bridge and lifecycle scoping
- Introduce `hostHTTPOperationBridge` to manage, claim, and cancel host HTTP operations with scoped cleanups
- Scope HTTP operations and streams to specific plugin instances to isolate lifecycles and prevent cross-plugin access
- Add RPC handlers for `MethodHostHTTPOperationOpen` and `MethodHostHTTPCancel`
- Link operation cancellation and resource cleanup to host callback contexts and stream termination

Closes: #6085
2026-09-24 06:08:51 +08:00
Luis Pater
aafa4e9549 fix(auth): isolate credential-scoped quota cooldown from model quota state
- Track credential cooldown deadlines independently from individual model quota recovery deadlines
- Use dedicated credential backoff levels and state instead of inheriting model-specific backoff during 429 handling
- Ensure auth-level quota recovery timestamps only retain previous deadlines when the existing reason is `credential_quota`

Closes: #6083
2026-09-24 00:10:54 +08:00
Luis Pater
5af6cd7582 fix(gemini): stringify function responses containing JSON schema $ref
- Detect `$ref` properties in function response results via `ContainsJSONRef`
- Stringify results containing `$ref` under `response.result` to avoid Gemini and Vertex AI treating them as media references
- Apply helper across Claude, OpenAI responses, and interactions translators for Gemini and Antigravity

Closes: #6065
2026-09-23 20:50:40 +08:00
Luis Pater
2fe9932bb9 feat(usage): track execution request ID and trace ID across usage records
- Add `RequestID` (unique execution UUID) and `TraceID` (inbound request ID) fields to usage records and plugin API
- Generate unique UUIDs per model attempt in `UsageReporter` while linking to parent trace context
- Expose `execution_id` and `trace_id` in Redis queue usage payloads while preserving legacy `request_id`
2026-09-23 19:31:39 +08:00
Luis Pater
e6fcfa34ba fix(logging): prevent request log collisions and select latest log by ID
- Switch request ID generation to an atomic incrementing 8-character hex counter
- Create unique log files with numeric sequence fallback to prevent overwriting existing logs
- Select the latest log file matching request ID based on modification time and filename sequence in management API
2026-09-23 13:03:05 +08:00
Luis Pater
65459cace0 feat(registry): update devin model definitions
- Add Claude Opus, GPT-6, GPT-5.6, and Kimi K3 model variants
- Update token limits, context lengths, and thinking levels across Devin models
2026-09-23 09:49:14 +08:00
Luis Pater
580df95a94 fix(antigravity): sanitize Claude tool IDs and resolve collisions
- Sanitize tool call IDs with `SanitizeClaudeToolID` and deduplicate collisions using numeric suffixes
- Track raw tool call IDs to correctly match tool responses from turns

Closes: #6056
2026-09-23 09:44:04 +08:00
Luis Pater
673131f574 fix(codex): compact client model catalog and preserve required fields
- Marshal Codex client catalog as compact single-line JSON without HTML escaping
- Use compact base instructions for non-template models to stay within the 1MiB payload limit
- Keep `apply_patch_tool_type`, `upgrade`, and `availability_nux` present as null instead of deleting them
v7.3.15
2026-09-23 08:54:52 +08:00
Luis Pater
bd584a7523 feat(claude): support Claude Code 2.1.280 feature-gated betas
- Add header definitions and ordering for per-turn control, timing, inline tools, clear-at, dangerous tool use, thinking binding/resumption, and prompt caching evict betas
- Dynamically assemble beta headers based on model capabilities and request body fields matching Claude Code 2.1.280 behavior

Closes: #6054
2026-09-23 08:11:33 +08:00
Luis Pater
779bf317e0 feat(claude): bump claude cli baseline to 2.1.280 and support tool changes beta
- Update default Claude CLI version to 2.1.280 in cloaking and device profile
- Add `mid-conversation-tool-changes-2026-07-01` beta header support for supported models

Closes: #6054
2026-09-23 05:07:49 +08:00
Luis Pater
fc914b9deb feat(registry): add grok-4.7-build-fast model and update grok-4.7
- Add `grok-4.7-build-fast` model definition
- Update supported modalities and created timestamp for `grok-4.7`
2026-09-23 04:49:21 +08:00
Luis Pater
e01806f971 docs(readme): add CLIProxy Quota Tray to community projects 2026-09-23 04:44:11 +08:00
Luis Pater
1efd01dc72 Merge pull request #6049 from ZYHUO/main 2026-09-23 04:41:55 +08:00
Luis Pater
937ebb8f11 feat(registry): add gpt-6-luna model to codex-free
- Add `gpt-6-luna` model definition under `codex-free` registry entries

Closes: #6055
v7.3.14
2026-09-23 04:31:32 +08:00
Luis Pater
a962b77d43 feat(server): support trusted proxies configuration for client IP resolution
- Add `trusted-proxies` configuration option with IP and CIDR validation
- Apply trusted proxies to Gin engine to properly resolve forwarded client IPs
- Record `ResolvedClientIP` in request metadata and usage queue details

Closes: #6024
2026-09-23 04:26:45 +08:00
Luis Pater
2430354330 feat(registry): update model definitions and bump codex client version to 0.155.0
- Add Claude Opus 5.5 and GPT-6 (Sol and Luna) model entries
- Add native web search capability metadata across Gemini and Antigravity models
- Bump default Codex client version to 0.155.0 in model fetching script
v7.3.13
2026-09-23 02:41:31 +08:00