Skip to content

fix(providers): route OpenAI responses-only models to /v1/responses (#5842) - #5901

Merged
diegosouzapw merged 5 commits into
release/v3.8.43from
fix/5842-openai-responses-endpoint
Jul 2, 2026
Merged

diegosouzapw merged 5 commits into
release/v3.8.43from
fix/5842-openai-responses-endpoint

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Closes #5842

Root cause

The native openai provider is hard-wired to https://api.openai.com/v1/chat/completions with no per-model endpoint routing, yet the curated catalog ships gpt-5.5-pro and gpt-5.4-pro — models OpenAI only serves via /v1/responses. Every request (and "Test all models", which goes through the internal /v1/chat/completions route → handleChatCore) 404s with "only supported in v1/responses" / "not a chat model".

Fix (wires existing plumbing — no new mechanisms)

  • Registry (open-sse/config/providers/registry/openai/index.ts): tag gpt-5.5-pro / gpt-5.4-pro with targetFormat: "openai-responses" — the per-model translation mechanism already used by gh/codex/opencode; chatCore picks it up via resolveChatCoreTargetFormat and translates Chat↔Responses both ways.
  • Heuristic (open-sse/config/providerModels.ts::getModelTargetFormat): dynamically-synced OpenAI ids ending in -pro (e.g. o1-pro, gpt-5.2-pro from the reporter's list — not in our catalog) resolve to openai-responses. Scoped to the openai alias; mirrors the gh executor's /codex/i routing (9router#102). Keeping the heuristic inside getModelTargetFormat keeps the URL and the body translation in lockstep from a single source of truth.
  • Executor (open-sse/executors/default.ts::buildUrl): new case "openai" swaps /chat/completions → /responses when the model's targetFormat is openai-responses, honoring a custom base URL (proxy/gateway) for both endpoints.

Out of scope (noted in the issue): gpt-3.5-turbo-instruct is a legacy /v1/completions model — not in our catalog and OmniRoute has no legacy completions upstream.

Validation (TDD, Hard Rule #18)

  • tests/unit/openai-responses-only-models-5842.test.ts written first → 5 failures on the unfixed code (registry untagged, heuristic absent, buildUrl pinned to chat/completions) → 8/8 pass after the fix.
  • Neighboring suites: all *responses* + *target-format* unit files → 252/252 pass (includes custom-model-target-format, copilot-gemini-claude-route-no-responses, chatcore-target-format).
  • check:provider-consistency → OK (171 REGISTRY entries).
  • typecheck:core → only the pre-existing open-sse/executors/base.ts errors, byte-identical on the clean release tip (untouched by this PR).
  • ESLint on changed files → clean.

Plan: _tasks/fixes-v3.8.43/5842-openai-responses-only-models.plan.md

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@janeza2

janeza2 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

does this fix cover to codex oauth provider?

@diegosouzapw

Copy link
Copy Markdown
Owner Author

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: provider-translate-path-golden fails identically (2 pass / 1 fail) on this branch and on the pristine tip, and the opencode-executor failures reproduce on the tip (this PR's -pro heuristic is scoped to the openai alias; opencode resolves via its own alias). This PR's own guards: openai-responses-only-models-5842 8/8, neighboring responses/target-format suites 252/252, executor base suites 71/71. Merging with admin, same rationale as #5896/#5902.

@diegosouzapw
diegosouzapw merged commit cbc161b into release/v3.8.43 Jul 2, 2026
3 checks passed
@diegosouzapw
diegosouzapw deleted the fix/5842-openai-responses-endpoint branch July 2, 2026 11:22
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants