mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-22 07:02:16 +03:00
Adds an opt-in toggle for Anthropic Fast Mode (speed:"fast") on the
Settings > AI page, mirroring the existing CodexFastTierTab pattern. The
behavior pairs with a CLIProxyAPI build that opts SDK-shaped traffic into
the Fast Mode entrypoint; OmniRoute signals the intent via a single
outbound header. Builds of CPA that do not recognize the header forward
it harmlessly.
- New helper: src/lib/providers/claudeFastMode.ts exposes
isClaudeFastModeEnabled / getClaudeFastModeSupportedModels /
shouldRequestClaudeFastMode plus the CPA_FORCE_FAST_MODE_HEADER
constant ("X-CPA-Force-Fast-Mode").
- New Card component: ClaudeFastModeTab.tsx — same Card+Toggle shape
as CodexFastTierTab.tsx, with a collapsible per-model checkbox group
(defaults to claude-opus-4-7 and claude-opus-4-6, matching the binary
KT() gate observed in claude-code v2.1.145).
- Schema: claudeFastMode { enabled?, supportedModels? } added to
updateSettingsSchema and to the getSettings() defaults.
- Middleware: buildUpstreamHeadersForExecute in chatCore.ts now sets
X-CPA-Force-Fast-Mode: 1 when provider === "claude" and the model
matches the configured supportedModels list.
- i18n: 6 new keys added with hand translations for en/fr/es/de and
__MISSING__: sentinels for the remaining 38 locales so a subsequent
scripts/i18n/sync-ui-keys.mjs pass can fill them in.
Default behavior is unchanged: the toggle defaults off, so accounts
that have not opted in keep their existing claude request flow. Even
when enabled, Anthropic enforces subscription tier and Fast Mode credit
balance server-side — the toggle may still surface out_of_credits or a
similar 429 from upstream.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>