mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
fix(openai): use Responses API for gpt-5.4 (#7982)
Signed-off-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -233,6 +233,7 @@ impl OpenAiProvider {
|
||||
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")
|
||||
}
|
||||
|
||||
fn should_use_responses_api(model_name: &str, base_path: &str) -> bool {
|
||||
@@ -728,6 +729,22 @@ mod tests {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gpt_5_4_uses_responses_when_base_path_is_default() {
|
||||
assert!(OpenAiProvider::should_use_responses_api(
|
||||
"gpt-5.4",
|
||||
"v1/chat/completions"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gpt_5_4_with_date_uses_responses() {
|
||||
assert!(OpenAiProvider::should_use_responses_api(
|
||||
"gpt-5.4-2026-03-01",
|
||||
"v1/chat/completions"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gpt_4o_does_not_use_responses() {
|
||||
assert!(!OpenAiProvider::should_use_responses_api(
|
||||
|
||||
Reference in New Issue
Block a user