Repository navigation
fix(sdk): support v8 consumers on CLIProxyAPI v8.0.34 - #11
Merged
Merged
Conversation
…lay by target - Add InspectMetaReasoningSignature transport-shape validation (canonical unpadded base64url, observed 43e3da0e01 header, 45 + 1024*2^k decoded buckets) and SignatureProviderMeta detection/compatibility wiring - Make Meta Responses sanitization native-only so GPT, foreign, and unknown signatures never replay to Meta, while compat paths preserve Meta envelopes only for Meta-family target models - Preserve recognized Meta signatures through Claude-protocol request translation for muse-* targets and drop them for other targets; never supplement them as Devin sealed signatures - Cover with synthetic-fixture unit tests only; verified same-model, cross-model, and Claude-ingress live replay plus wrong-upstream stripping on an isolated debug CPA
…otocol - Surface Responses reasoning summary as Gemini thought parts and encrypted_content as thoughtSignature in streaming and non-streaming Codex-to-Gemini responses, with an empty carrier part when no summary text exists - Restore client-echoed thoughtSignature values to reasoning items only when the detected signature family matches the target model family, so Meta/GPT/Grok signatures replay to their own upstream and never leak to a wrong one - Verified live on muse-wonder-full-1.0-contributor at high reasoning effort: same-turn signature issuance, next-turn replay retention by hash, early-body tamper forwarded to Meta, and header tamper stripped before upstream
…rder-preserving - Encode Responses signatures for Gemini thoughtSignature as a versioned carrier in standard padded base64 so official SDK []byte decoding succeeds, and unwrap plus normalize (including cache prefixes) on Gemini ingress - Queue streamed function-call outputs in order and flush on every return path so a pending thought signature can no longer be overwritten or bypassed; deduplicate repeated reasoning done events and never spend a signature on an empty text delta - Resolve signature provider family from the canonical last model-id segment so namespace prefixes cannot outrank the actual model, and reject non-bucket Meta lengths before decoding - Verified live at high reasoning effort: carrier round-trip replay by hash, early-body tamper forwarded to Meta, header tamper stripped before upstream
OpenRouter serves meta/muse-* through its Responses API and returns
encrypted_content as the native Meta envelope plus "." and a 67-char
alphanumeric routing suffix. The strict Meta inspector rejected that form,
so it was classified unknown and stripped on every path, including the
compat Meta-target path that previously kept unknown blobs.
- Accept an optional "."+[A-Za-z0-9]{1,128} router suffix after a valid
native envelope and expose it as RouterSuffix; replay stays verbatim
- Replace the keepMeta flag with a Meta policy: Meta-family targets on the
Codex executor allow routed envelopes regardless of is-compat, while the
native Meta executor stays native-only (suffix acceptance by api.meta.ai
is unverified)
- Live-checked on OpenRouter: native part matches the api.meta.ai header
and bucket shape (5/5), suffixed, native-only and suffix-tampered replays
are consumed, native-body tamper is silently dropped
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… protocol The Codex-format Interactions translator dropped encrypted_content from responses and ignored client-echoed thought signatures, so Interactions clients could never replay reasoning to Meta Muse (native or OpenRouter) or any other Codex-format upstream. - Emit encrypted_content verbatim as the thought step signature (non-stream) and as a thought_signature step delta (stream), deduplicating repeated reasoning done events - Restore echoed signatures as reasoning encrypted_content only when the detected family matches the target model; request encrypted reasoning via include - Share the family-match/normalization rule with the Gemini translator via translatorcommon.CodexReplaySignatureForTarget Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…nses providers - Gate MetaExecutor signature sanitization by baseURL so custom/third-party meta-api-key endpoints replay router-suffixed Meta Muse envelopes while native api.meta.ai stays native-only - Pass resolved target model (with requested-model fallback for aliased deployments) through Codex, Codex WebSocket, and OpenAI-compat Responses sanitization paths - Broaden Meta Muse model-id boundary matching (muse, meta/muse, muse_*, meta-muse-*) and allow Meta envelopes in the Codex reasoning replay cache - Reuse CodexReplaySignatureForTarget in Claude-to-Codex request translation and avoid duplicating streamed thought summaries on Interactions reasoning done events
…-family Responses targets - Allow optional dot-delimited alphanumeric router suffixes (such as OpenRouter endpoint_slug metadata) in InspectGPTReasoningSignature and InspectGrokEncryptedContent - Preserve matching target-family signatures (Grok, Gemini, Claude, Kimi, SWE) in sanitizeOpenAIResponsesReasoningEncryptedContentWithCompatModel when served through Responses routers
… non-OpenRouter upstreams - Only preserve OpenRouter dot-delimited router suffixes when the upstream baseURL is openrouter.ai / *.openrouter.ai - Strip RouterSuffix down to the native GPT/Grok/Meta envelope when forwarding to official tokens (chatgpt.com, api.openai.com, api.x.ai) or non-OpenRouter third-party providers (while keeping native api.meta.ai fail-closed against cross-caller envelopes) - Strip RouterSuffix before storing GPT signatures in the Codex reasoning replay cache
- Use Go quoting (`%q`) for the request path in the Gin logrus logger format string. - Prevent unescaped line breaks from raw encoded newlines in request paths from splitting log entries. Closes: router-for-me#6731
…gnature-replay feat(signature): support Meta Muse & router-suffixed reasoning signatures across Responses, Claude, Gemini, and Interactions
…serve literal values - Expand local `$ref` definitions before stripping schema definition containers to prevent nested field loss. - Preserve schema-looking keys inside literal data keywords (`default`, `example`, `examples`, `const`, `enum`). - Add comprehensive test coverage for schema inlining, literal preservation, and wrapped Antigravity tool schemas. Closes: router-for-me#6732
…validation and locking - Implement `Modify` method on auth manager to load, clone, edit, and commit records atomically under a per-auth mutation lock. - Refactor auth field patches and status updates to use the new `Modify` API, preventing race conditions and lost concurrent updates. - Add comprehensive test coverage verifying concurrent patch operations, token refreshes, removals, and epoch checks. Closes: router-for-me#6733
…omplete or in-place file writes - Track incomplete JSON and unreadable files during auth snapshots, retaining existing auth indexes and preventing premature credential removals during in-place writes. - Buffer and restore active auths during affected provider reloads when auth files are temporarily truncated or unparseable. - Add comprehensive test coverage for in-place file truncation, partial JSON recovery, and provider reload race conditions. Closes: router-for-me#6734
… retrieval by channel - Implement fallback logic in model definitions handler to query plugin host and global registry for unknown channels. - Add sorting for registry model definitions by provider and ID to ensure consistent responses. Closes: router-for-me#6736
…n OpenAI response translators - Cache and reuse initial request JSON and tool name maps across stream chunks to avoid redundant evaluations and prevent map resets. - Add robust state flags to track request and tool map resolution state for Gemini chat and responses translators. Closes: router-for-me#6741
…rove rejected token handling - Update Codex outer refresh lead time to 96 hours to prevent upstream token invalidation. - Ensure proper token refreshing and background recovery for rejected unexpired JWTs and in-stream 401 errors. Closes: router-for-me#6742
…ecutor registration - Snapshot plugin scheduler and preferences atomically to prevent deadlocks and data races during auth picking. - Release host lock before notifying executor manager during adapter registration to prevent lock contention. Closes: router-for-me#6744
…ery and retry logic - Add freshness validation helper for antigravity credits hints and synchronize the refresh interval constant. - Allow expired negative credits hints to trigger re-validation and clear permanent failure state upon successful recovery. - Include `INSUFFICIENT_G1_CREDITS_BALANCE` in full quota exhaustion decisions and ensure candidates with expired negative hints are re-queried. Closes: router-for-me#6745
…aude response translator - Cache and reuse resolved stream configuration and tool name maps across stream chunks to avoid redundant request body parsing. - Introduce dedicated state flags in conversion parameters to track resolution status safely. Closes: router-for-me#6746
… sessions - Implement LRU cache and helpers for Claude native web search tool results. - Record search results from stream events and responses, and restore them in subsequent requests. - Add configuration options and test coverage for Claude web search result caching. Closes: router-for-me#6753
Return an empty catalog when home returns no model records, e.g. when the client's access scopes have no routes, instead of erroring. Still reject null payloads, null sections, and non-empty sections with no usable model IDs as malformed.
Reject any home models payload containing an error key before parsing provider sections. Array-shaped error values were previously treated as model sections, masking upstream errors as valid or empty catalogs instead of returning an error.
fix(api): allow empty home model catalog
…oute - Route Vertex partner/open MaaS models and explicit openapi-enabled credentials through the OpenAI-compatible endpoints/openapi endpoint while reusing service-account OAuth token acquisition and supporting openapi_location overrides. - Register Vertex service-account MaaS models and aliases from credential metadata and OAuth alias rules so partner models are discoverable and routable. - Normalize Vertex OpenAPI model identifiers and reject static API keys against official Google Vertex OpenAPI hosts that require OAuth tokens. Closes: router-for-me#6763
…never or uncloak - Strip incoming Claude Code billing attribution, CLI identity system blocks, metadata user IDs, and diagnostics when a non-CLI API key explicitly configures cloak mode as never or uncloak. - Remove Claude Code CLI headers, beta flags, and user-agent strings on uncloaked API key requests while preserving capability betas and credential header overrides. - Keep global disable-claude-cloak-mode passthrough behavior unchanged for credentials without explicit per-key cloak configuration. Closes: router-for-me#6762
- Pass the client-requested model into xAI image generation and edit handlers and resolve the routing model from registered xAI models instead of re-reading the stripped canonical model from the upstream request payload. - Allow custom xAI credential prefixes in xAI image model validation while preserving built-in prefix fallback when force-model-prefix is disabled. Closes: router-for-me#6768
… non-codex routes - Set `tool_mode` to `"direct"` and disable `use_responses_lite` and `supports_reasoning_effort_updates` when normalizing Codex catalog entries for non-template models and non-Codex or mixed-provider routes. - Reset `tool_mode`, `use_responses_lite`, and `supports_reasoning_effort_updates` when synthesizing a fallback `gpt-5.5` baseline template in `fetch_codex_models`. Closes: router-for-me#6769
…arations - Inject a web_search tool declaration for standard Codex requests when input replays web_search_call items without a web_search tool so upstream response protection remains available during compaction. - Strip replayed web_search_call items from Responses Lite requests where top-level hosted tool declarations are omitted. Closes: router-for-me#6770
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fork declares the CLIProxyAPI v8 module, but its exported executor wrappers still import v7 internal packages. Consumers cannot compile these SDK wrappers as v8.
Sync the fork with upstream stable v8.0.34, then update the seven imports in the Codex, Antigravity and xAI wrappers to v8. The upstream sync and the three-file SDK fix are separate commits so the integration change is easy to review. Existing wrapper constructors and APIs remain intact.
Validation:
go test -count=1 -timeout 600s ./...,go test ./sdk/exec,go build -o /workspace/scratch/cpa-v8/cpa-server ./cmd/server, andgit diff --checkpassed locally. Maxx's real SDK protocol tests also passed all 24 cases covering Codex, Antigravity/Gemini, Antigravity/Claude and Grok, streaming/non-streaming, HTTP 401/429, and Antigravity OAuth refresh against local fixtures.This is the prerequisite for migrating awsl-project/maxx from CLIProxyAPI v7 to v8.
CI status: the server build passes. Two inherited upstream policy checks currently fail: the translator-path guard also sees the upstream translator changes included in this stable-version sync, and the auto-retarget workflow attempts to use a
devbranch that does not exist in this fork. These are repository-policy failures; local full tests and the SDK consumer protocol checks passed.Maxx consumer migration: awsl-project/maxx#944. Merge this SDK update before the consumer migration so subsequent automated v8 syncs retain working wrappers.