Commit Graph

1122 Commits

Author SHA1 Message Date
Luis Pater
b7f321f2a1 feat(api): support request path overrides and image protocols in model execution
- Add `Path` field to model execution requests and plugin interceptor responses
- Propagate custom request paths through execution metadata
- Allow image models during execution when entry or exit protocol is `openai-image`

Closes: #6196
2026-09-29 22:44:33 +08:00
Luis Pater
a0cc065d4d fix(claude): distinguish claude-sonnet-5-5 from sonnet-5 in model checks
- Add `isClaudeSonnet55Model` helper and prevent Sonnet 5 matching on Sonnet 5.5 prefixes
- Include Claude Sonnet 5.5 in progress display checks

Closes: #6193
2026-09-29 21:21:58 +08:00
Luis Pater
673e58d55c Merge pull request #6176 from router-for-me/home 2026-09-28 20:47:09 +08:00
hkfires
ac42accc88 fix(openai): use routed home model compatibility options 2026-09-28 20:40:10 +08:00
Luis Pater
e8156ec775 Merge pull request #6175 from magoz/fix/claude-oauth-tool-change-alias
fix(claude): remap MCP aliases in tool_addition/tool_removal blocks
2026-09-28 19:22:35 +08:00
hkfires
d3cd466ddb fix(codex): use resolved compat for multi-agent v2 2026-09-28 19:03:22 +08:00
hkfires
b9971ee3df feat(sdk): add Home credential capabilities and quota APIs
Use Home credential options as authoritative model capability
configuration for compat handling and prompt cache behavior.

Expose quota provider operations through the public plugin host API.
2026-09-28 19:03:21 +08:00
Luis Pater
59baf7314a feat(codex): extract and persist subscription plan type
- Extract `plan_type` from JWT claims and default missing values to `free`
- Include `plan_type` in token data, token storage, auth attributes, and file synthesis
- Ensure `plan_type` is maintained across token refresh flows
- Preserve empty map allocations during auth object cloning
2026-09-28 18:54:03 +08:00
magoz
958eeca719 fix(claude): remap MCP aliases in tool_addition/tool_removal blocks
- Rewrite `tool.name` of mid-conversation `tool_addition`/`tool_removal` blocks with a `tool_reference` to the same MCP alias as `tools[]`
- Rewrite `tool.definition.name` of inline `tool_definition` additions that redefine a declared custom tool
- Apply the same rewrite in the batched-edits and legacy remap paths
- Prevent upstream `references unknown tool` 400s for cloaked requests using mid-conversation tool changes

Closes: #6174
2026-09-28 10:12:12 +00:00
Luis Pater
48686ccc8f feat(config): preserve unknown nested fields as comments during v8 migration
- Traverse nested configuration paths to comment out unrecognized fields during v8 migration
- Remove deprecated Codex `identity-confuse` configuration option and request handling
- Clean up identity confuse mapping logic from Codex HTTP and WebSocket executors
2026-09-28 10:46:32 +08:00
Luis Pater
2c27e61fe7 fix(meta): strip unsupported search_content_types from web search tools
- Add `SanitizeMetaWebSearchTools` to remove `search_content_types` from `web_search` tool definitions
- Support sanitizing nested tools within `namespace` tool definitions
- Apply web search tool sanitization during Meta request preparation

Closes: #6156
2026-09-27 22:54:19 +08:00
Luis Pater
31f4cfab3f feat: migrate CLIProxyAPI to version 8 2026-09-27 14:42:26 +08:00
hkfires
d9922f0589 feat(config): add v8 configuration API
Introduce the v8 management configuration tree with migration-aware reads and
writes, grouped upstream API-key providers, and independent v8 operational
routes.

Preserve legacy configuration compatibility while ensuring successful v8 writes
migrate layouts, redact JSON TURN secrets, and keep OAuth-only provider
settings from affecting API-key credentials.
2026-09-27 14:16:27 +08:00
Luis Pater
6dea3dfa13 fix(antigravity): extract and apply reasoning summary config for OpenAI responses
- Use `ExtractSummaryConfig` to parse summary configuration from OpenAI response payloads
- Default to enabled auto summaries when reasoning effort is set without explicit summary visibility
- Apply the resolved summary configuration directly to Antigravity translations

Closes: #6143
2026-09-27 02:35:18 +08:00
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
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
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
2026-09-26 13:57:06 +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
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
2026-09-25 03:05:24 +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ù
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
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
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
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
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
f351924f42 feat(codex): add support for disable codex cloaking per credential
Closes: #6034
2026-09-22 22:39:20 +08:00
Luis Pater
4b5adbbe9a feat(openai): support video input in responses request translation
- Convert `input_video` and `video_url` content parts to chat completion video parts
- Preserve video URL and processing options for upstream handling

Closes: #6037
2026-09-22 21:38:10 +08:00
Luis Pater
320100ecf7 fix(codex): strip octal NUL pattern escapes from tool schemas
- Strip octal NUL (`\0`) escapes in regex patterns to prevent rejection by strict upstream JSON Schema validators
- Update tool schema normalization fast-path to check for serialized `\0` escape sequences

Closes: #6025
2026-09-22 18:25:48 +08:00
Luis Pater
a26cf2a8c2 perf(executor): avoid discarded copies of Gemini and Kimi stream lines
Read Gemini interactions scanner lines directly because emitted frames are already cloned before reuse, and allocate each Kimi responses passthrough chunk once so it stays owned without a second copy.
2026-09-22 08:32:35 +08:00
Luis Pater
f6d582cb68 Merge pull request #5678 from cookerpapa/perf/codex-stream-copy
perf(codex): avoid discarded copies of SSE data lines
2026-09-22 08:27:31 +08:00
Luis Pater
639b7f1126 perf(executor): reuse identical Claude and Gemini request translations
Skip the second compatibility translation for Claude, Gemini, and Gemini
interactions when the baseline and working payloads share a backing array
and no plugin hooks are installed. Keep independent buffers, the existing
hook order, and native interactions copies.
2026-09-22 05:16:25 +08:00
Luis Pater
5083f65037 Merge pull request #5990 from jack-5566/fix/responses-request-cache-pr
perf: cache Responses request validation and index tool declarations
2026-09-22 04:51:07 +08:00
Luis Pater
7f63f8c8d2 Merge pull request #5680 from cookerpapa/perf/codex-tool-schema-batch
perf(codex): batch tool schema rewrites
2026-09-22 04:23:03 +08:00
Luis Pater
d582067c06 feat(executor): support execution-scoped request proxy overrides
- Add context helpers to manage execution-scoped proxy overrides
- Prioritize request proxy over credential and global proxy settings across HTTP and uTLS clients
- Propagate request proxy in conductor execution and plugin host adapters
- Isolate Codex WebSocket connection reuse by proxy endpoint

Closes: #6013
2026-09-22 03:54:34 +08:00
sususu
bf44a7f892 style: gofmt codex bootstrap and cache-control tests 2026-09-22 00:18:05 +08:00
sususu
ed751ea08a fix(claude): gate fallback-credit beta on fallback tokens or explicit fallbacks 2026-09-21 10:17:25 +08:00
Luis Pater
fd5cd228a8 test(executor): allow non-negative TTFT in xAI usage record assertions
- Accept zero TTFT duration to accommodate sub-tick loopback responses
- Add unit test verifying zero TTFT validation in usage records

Closes: #5996
2026-09-21 10:15:52 +08:00
Luis Pater
a5ab69521f feat: add full support for kimi.ai oauth and runtime execution 2026-09-21 04:13:44 +08:00
Luis Pater
563865e77a test: fix timing synchronization and channel races in streaming tests
- Wait for bootstrap initialization before advancing mock clock in Codex WebSocket tests
- Reorder data channel closures in OpenAI responses stream error tests
- Drain stream chunks in byte-cap release test to prevent dangling goroutines

Closes: #5981
2026-09-21 00:39:28 +08:00
jack
8a6a39684d perf: index Responses tools and cache stream request validation 2026-09-20 23:10:57 +09:00
sususu
c52ca7bd4e docs(claude): clarify patch version floor rationale for native passthrough 2026-09-20 19:26:48 +08:00
camy-x
83a4913aa4 fix(claude): accept newer patch releases as native clients (#5820) 2026-09-20 19:15:51 +08:00
Luis Pater
42c9680eee feat(executor): support duplex streaming for codex websockets
- Implement `streamCodexDuplex` to handle bidirectional WebSocket interactions for Codex
- Support steering continuations (`response.steer`) and queued creations (`response.create`, `response.append`)
- Preserve response settings and state transitions across steering updates and automatic successors
- Isolate connection-level failures with `codexDuplexConnectionError` to prevent unnecessary credential cooldowns

Closes: #5968
2026-09-20 00:02:10 +08:00
Luis Pater
c93978c4ea fix(schema): normalize true boolean subschemas and strip unsupported keywords
- Normalize boolean `true` subschemas across root, properties, items, definitions, and dependencies into empty object schemas `{}`
- Include `dependencies` in schema definition traversal and normalization
- Strip unsupported schema keywords including `additionalItems`, `unevaluatedProperties`, `unevaluatedItems`, and `contentSchema`

Closes: #3551
2026-09-19 03:07:33 +08:00