Cache the in-flight xxhash-wasm initialization so concurrent calls reuse
the same promise before the raw hash function is available.
This avoids redundant loader work and prevents races during early CCH
computations.
Persist background degradation settings as structured data so they can
be reloaded during node startup without double-encoding JSON.
Update settings validation to accept the missing fields used by the
API and align models.dev sync interval bounds with millisecond-based
values.
Also strip omniModel tags when they are wrapped by either literal
escaped newlines or actual newline characters, and adjust the combo
routing test to match the cleaned streamed content.
Add automated SQLite health diagnostics with optional auto-repair,
startup and scheduled execution, authenticated API routes, an MCP tool,
and dashboard visibility for status and repair actions.
Improve provider compatibility by adding Cursor usage fetching and
v3.1.0 parity headers, introducing a per-connection Codex Responses
store opt-in with session fallback, fixing Codex non-stream combo and
SSE translation behavior, sanitizing Gemini googleSearch tool payloads
and Qwen thinking tool_choice handling, and hardening cleanup and call
log storage paths.
CLIProxyAPI works without bans using hardcoded darwin/arm64 in the
Antigravity User-Agent. Real Antigravity is a macOS desktop tool —
reporting the actual server OS (linux/amd64 on a VPS) is MORE
suspicious than always claiming darwin/arm64. Matches proven
production fingerprint.
Matches the Antigravity executor treatment:
- Dynamic User-Agent: GeminiCLI/0.31.0/MODEL (OS; ARCH) per-model
- X-Goog-Api-Client: maintained (was already correct)
- Header scrubbing: removes proxy/fingerprint headers
- Sensitive word obfuscation in user message content
- Tracks current model for per-request UA generation
Brings the Antigravity executor to parity with CLIProxyAPI and
ZeroGravity for Gemini/Google traffic handling.
New modules:
- antigravityHeaderScrub.ts: Removes 28 proxy/fingerprint/Chromium
headers that reveal non-native traffic. Sets Accept-Encoding to
'gzip, deflate, br' (Node.js default).
- antigravity429Engine.ts: 4-tier 429 classification (unknown,
rate_limited, quota_exhausted, soft_rate_limit) with nuanced
retry decisions (soft_retry, instant_retry, short_cooldown,
full_quota_exhausted). Per-auth credits failure tracking with
auto-disable after 3 failures (5h cooldown).
- antigravityCredits.ts: Google One AI credits injection — retries
quota_exhausted 429s with enabledCreditTypes: ['GOOGLE_ONE_AI'].
Enabled via ANTIGRAVITY_CREDITS=1 env var.
- antigravityHeaders.ts: Dynamic User-Agent from OS/arch
(antigravity/1.21.9 darwin/arm64), Gemini CLI UA per-model
(GeminiCLI/0.31.0/MODEL (OS; ARCH)), X-Goog-Api-Client header
(google-genai-sdk/1.41.0 gl-node/v22.19.0).
- antigravityObfuscation.ts: Sensitive word obfuscation using
zero-width joiners for 17 client names (matching ZeroGravity).
Updated antigravity.ts:
- Dynamic UA replaces hardcoded 'antigravity/1.104.0 darwin/arm64'
- X-Goog-Api-Client header added (was missing entirely)
- Header scrubbing on all outbound requests
- 4-tier 429 engine replaces 2-category classification
- Google One AI credits retry on quota_exhausted
- Sensitive word obfuscation in user message content
Squash merge of feat/claude-code-native-parity into release/v3.6.5.
## Wiring
1. base.ts: CCH xxHash64 body signing for anthropic-compatible-cc-* providers,
applied after CLI fingerprint ordering so the hash covers the final bytes
sent upstream.
2. chatCore.ts: After buildClaudeCodeCompatibleRequest(), applies synchronous
parity pipeline steps:
- remapToolNamesInRequest() — TitleCase tool name mapping (14 tools)
- enforceThinkingTemperature() — temperature=1 when thinking active
- disableThinkingIfToolChoiceForced() — remove thinking on forced tool_choice
Cache-control limit enforcement intentionally omitted from chatCore because
the billing-header system block counts toward the 4-block cap and would strip
legitimate client cache markers.
3. xxhash-wasm: installed (was declared in package.json by PR but not installed).
## Test updates
- tests/unit/claude-code-parity.test.mjs: 25 new tests covering CCH signing,
fingerprint computation, tool remapping, and API constraints.
- tests/unit/cc-compatible-provider.test.mjs: fixed pre-existing assertion that
expected no cache_control on system blocks (billing header now carries ephemeral
per PR #1188 design).
Closes#1188
Integrated into release/v3.6.5. Fixed accountId key consistency between executor and fetcher. Added 13 unit tests for credit cache helpers, SSE parsing, and accountId derivation contract.
Integrated into release/v3.6.5. Added CHANGELOG breaking change entry for the removed /api/settings/codex-service-tier endpoint and deduplicated getCodexRequestDefaults in page.tsx (now imports from requestDefaults.ts).
Integrated into release/v3.6.5 — fixes Windows Electron packaged startup failure caused by split NODE_PATH between app.asar.unpacked and app/node_modules. Review improvement: added debug log for skipped candidate paths.
Fixes test expectations for non-streaming requests expecting 'Accept: application/json' instead of undefined. Resolves API_KEY_SECRET missing in unit tests post security hardening. Adds robust Playwright waits to combo E2E testing.
Protect database backup, export, restore, and translator save endpoints
with authentication checks to block unauthenticated data access and
state changes.
Also remove the insecure API key secret fallback, ignore nested app env
files from package publishes, and align tests with explicit
application/json Accept headers for non-stream requests
Load existing combos before normalizing POST and PUT payloads so
legacy string references can still resolve to combo-ref models.
This keeps stored combo references consistent while preserving DAG
validation for newly created and updated combos.
Move model routing management into Settings and add a unified
model alias editor for exact and wildcard remaps.
Sync combo defaults with global routing strategy settings, add
localized combo onboarding copy, and expand routing i18n across
supported locales.
Also fix supporting routing behavior by accepting all strategy
values in settings schemas, preserving connection ids in combo
tests, honoring non-stream JSON requests for CC-compatible
providers, and handling hashed external package subpaths.
Apply composite tier ordering to top-level combo steps and direct
targets so priority and round-robin strategies follow the configured
defaultTier to fallbackTier chain before using remaining steps.
Add defensive config parsing helpers, regression tests for composite
tier ordering, and documentation updates for the structured combo
builder, quota-aware P2C, and combo target health.
Updated mask-email.test.mjs and model-sync-route.test.mjs to match
the revised maskEmail function that preserves full domain names for
account differentiation (die********@gmail.com vs old di*********@g****.com).