fix(openai): use Responses API for gpt-5.4#7982
Conversation
Signed-off-by: Michael Neale <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2920e9437
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let normalized_model = model_name.to_ascii_lowercase(); | ||
| (normalized_model.starts_with("gpt-5") && normalized_model.contains("codex")) | ||
| || normalized_model.starts_with("gpt-5.2-pro") | ||
| || normalized_model.starts_with("gpt-5.4") |
There was a problem hiding this comment.
Restrict gpt-5.4 Responses routing to actual OpenAI endpoints
This broadens the host-agnostic model check so any OpenAI-compatible backend configured through OPENAI_HOST or a declarative engine: "openai" provider will now be switched from v1/chat/completions to /v1/responses whenever the model name starts with gpt-5.4. That breaks a supported configuration in this repo: the docs explicitly advertise non-OpenAI hosts on the OpenAI provider (documentation/docs/getting-started/providers.md) and register_declarative_provider sends every OpenAI-compatible custom provider through OpenAiProvider::from_custom_config (crates/goose/src/config/declarative_providers.rs:417-423). Any proxy or self-hosted endpoint that exposes a gpt-5.4* alias but only implements chat completions will now fail with 404/unsupported-endpoint errors.
Useful? React with 👍 / 👎.
| let normalized_model = model_name.to_ascii_lowercase(); | ||
| (normalized_model.starts_with("gpt-5") && normalized_model.contains("codex")) | ||
| || normalized_model.starts_with("gpt-5.2-pro") | ||
| || normalized_model.starts_with("gpt-5.4") |
There was a problem hiding this comment.
Handle provider-prefixed gpt-5.4 model IDs too
This matcher only catches bare IDs like gpt-5.4, so the fix still misses the slash-qualified model names that our OpenAI-compatible integrations already use. For example, bundled configs already accept namespaced OpenAI models such as openai/gpt-oss-120b (crates/goose/src/providers/declarative/groq.json), and the bundled canonical registry contains requesty/openai/gpt-5.4 and openrouter/openai/gpt-5.4 entries (crates/goose/src/providers/canonical/data/canonical_models.json). Requests sent with those provider-prefixed gpt-5.4 IDs will still go through chat completions, so the original tool-calling/reasoning_effort failure remains unresolved for those gateways.
Useful? React with 👍 / 👎.
* origin/main: fix(openai): use Responses API for gpt-5.4 (#7982) Remove lead/worker provider (#7989) chore(release): release version 1.28.0 (#7991) Fix empty tool results from resource content (e.g. auto visualiser) (#7866) Separate SSE streaming from POST work submission (#7834) fix: include token usage in Databricks streaming responses (#7959) Optimize tool summarization (#7938)
* main: (22 commits) feat: add gemini-acp provider, update docs on subscription models + improvements to codex (#8000) fix(openai): use Responses API for gpt-5.4 (#7982) Remove lead/worker provider (#7989) chore(release): release version 1.28.0 (#7991) Fix empty tool results from resource content (e.g. auto visualiser) (#7866) Separate SSE streaming from POST work submission (#7834) fix: include token usage in Databricks streaming responses (#7959) Optimize tool summarization (#7938) fix: overwrite the deprecated googledrive extension config (#7974) refactor: remove unnecessary Arc<Mutex> from tool execution pipeline (#7979) Revert message flush & test (#7966) docs: add Remote Access section with Telegram Gateway documentation (#7955) fix: update webmcp blog post metadata image URL (#7967) fix: clean up OAuth token cache on provider deletion (#7908) fix: hard-coded tool call id in code mode callback (#7939) Fix SSE parsers to accept optional space after data: prefix (#7929) docs: add GOOSE_INPUT_LIMIT to config-files.md (#7961) Add WebMCP for Beginners blog post (#7957) Fix download manager (#7933) Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (#7626) ...
Signed-off-by: Michael Neale <[email protected]> Signed-off-by: esnyder <[email protected]>
Signed-off-by: Michael Neale <[email protected]> Signed-off-by: esnyder <[email protected]>
Summary
gpt-5.4*models through OpenAI/v1/responsesby defaultgpt-5.4and date-suffixed variantsWhy
OpenAI rejects function tools +
reasoning_effortforgpt-5.4on/v1/chat/completionsand requires/v1/responses.Changes
OpenAiProvider::is_responses_modelnow treatsgpt-5.4*as Responses modelsgpt_5_4_uses_responses_when_base_path_is_defaultgpt_5_4_with_date_uses_responsesValidation
cargo fmt✅cargo test -p goose openai::tests1.90.0[email protected]and[email protected]require rustc1.91.1cargo clippy --all-targets -- -D warningsNotes
I only patched
gpt-5.4*as requested. There may be other future GPT-5 chat variants that also require/v1/responses, but this PR intentionally keeps scope narrow.