fix(providers): route OpenAI responses-only models to /v1/responses (#5842) - #5901
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
does this fix cover to codex oauth provider? |
…penai-responses-endpoint
…penai-responses-endpoint
|
CI: Vitest / dast-smoke (full build) / semgrep pass; the Fast Quality Gates job fails only at its TIA unit step, and every failing test there belongs to the 8 pre-existing base-red files tracked in #5798 — verified: |
…iegosouzapw#5842) (diegosouzapw#5901) * fix(providers): route OpenAI responses-only models to /v1/responses (diegosouzapw#5842) * docs(changelog): restore diegosouzapw#5842 bullet after merge auto-resolve ate it * docs(changelog): keep diegosouzapw#5842 bullet additive over release tip
Closes #5842
Root cause
The native
openaiprovider is hard-wired tohttps://api.openai.com/v1/chat/completionswith no per-model endpoint routing, yet the curated catalog shipsgpt-5.5-proandgpt-5.4-pro— models OpenAI only serves via/v1/responses. Every request (and "Test all models", which goes through the internal/v1/chat/completionsroute →handleChatCore) 404s with "only supported in v1/responses" / "not a chat model".Fix (wires existing plumbing — no new mechanisms)
open-sse/config/providers/registry/openai/index.ts): taggpt-5.5-pro/gpt-5.4-prowithtargetFormat: "openai-responses"— the per-model translation mechanism already used bygh/codex/opencode; chatCore picks it up viaresolveChatCoreTargetFormatand translates Chat↔Responses both ways.open-sse/config/providerModels.ts::getModelTargetFormat): dynamically-synced OpenAI ids ending in-pro(e.g.o1-pro,gpt-5.2-profrom the reporter's list — not in our catalog) resolve toopenai-responses. Scoped to theopenaialias; mirrors the gh executor's/codex/irouting (9router#102). Keeping the heuristic insidegetModelTargetFormatkeeps the URL and the body translation in lockstep from a single source of truth.open-sse/executors/default.ts::buildUrl): newcase "openai"swaps/chat/completions→/responseswhen the model's targetFormat isopenai-responses, honoring a custom base URL (proxy/gateway) for both endpoints.Out of scope (noted in the issue):
gpt-3.5-turbo-instructis a legacy/v1/completionsmodel — not in our catalog and OmniRoute has no legacy completions upstream.Validation (TDD, Hard Rule #18)
tests/unit/openai-responses-only-models-5842.test.tswritten first → 5 failures on the unfixed code (registry untagged, heuristic absent, buildUrl pinned to chat/completions) → 8/8 pass after the fix.*responses*+*target-format*unit files → 252/252 pass (includescustom-model-target-format,copilot-gemini-claude-route-no-responses,chatcore-target-format).check:provider-consistency→ OK (171 REGISTRY entries).typecheck:core→ only the pre-existingopen-sse/executors/base.tserrors, byte-identical on the clean release tip (untouched by this PR).Plan:
_tasks/fixes-v3.8.43/5842-openai-responses-only-models.plan.md