mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 13:22:11 +03:00
The claude→openai translator emits reasoning_effort=xhigh when the client sends output_config.effort=max on a Claude-shape request. Combined with runtime alias remapping (e.g. claude-opus-4-6 → mimo/mimo-v2.5-pro), this routes xhigh to OpenAI-shape providers that only accept low|medium|high: xiaomi-mimo 400 reasoning_effort: Input should be 'low','medium' or 'high' mistral/devstral 400 unrecognized field reasoning_effort github/claude-* 400 unrecognized field reasoning_effort Each rejection burns a combo fallback attempt before reaching a working provider, adding latency per turn and polluting logs. Add provider-aware sanitation in BaseExecutor.execute after transformRequest: - xiaomi-mimo and other non-xhigh providers: downgrade xhigh → high (gated by the supportsXHighEffort helper from providerModels.ts, so models that genuinely expose xhigh pass through unchanged) - mistral/devstral, github/claude|haiku|oswe: strip reasoning_effort entirely The hook runs after transformRequest so per-provider transforms that reintroduce reasoning_effort are also caught before fetch. Includes unit tests covering: xhigh downgrade (top-level and nested), strip-entirely for rejecting providers, no-op when effort is absent, no-op for non-object bodies, and pass-through for unknown providers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>