Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions crates/goose-provider-types/src/formats/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,8 @@ fn openai_reasoning_efforts_for_model(model_name: &str) -> &'static [&'static st
|| normalized.contains("gpt-5-4")
|| normalized.contains("gpt-5.5")
|| normalized.contains("gpt-5-5")
|| normalized.contains("gpt-5.6")
|| normalized.contains("gpt-5-6")
{
&["low", "medium", "high", "xhigh"]
} else {
Expand Down Expand Up @@ -2512,6 +2514,27 @@ mod tests {
Ok(())
}

#[test]
fn test_create_request_gpt56_max_effort_uses_xhigh() -> anyhow::Result<()> {
let model_config = test_model_config("gpt-5.6-luna")
.with_max_tokens(Some(1024))
.with_thinking_effort(ThinkingEffort::Max);
let request = create_request(
&model_config,
"system",
&[],
&[],
&ImageFormat::OpenAi,
false,
)?;
let obj = request.as_object().unwrap();

assert_eq!(obj.get("reasoning_effort"), Some(&json!("xhigh")));
assert!(obj.get("thinking_effort").is_none());

Ok(())
}

#[test]
fn test_create_request_gpt5_pro_max_effort_uses_supported_level() -> anyhow::Result<()> {
let model_config = test_model_config("gpt-5.2-pro-2025-12-11")
Expand Down
25 changes: 25 additions & 0 deletions crates/goose-providers/src/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ pub const OPEN_AI_KNOWN_MODELS: &[(&str, usize)] = &[
("gpt-5.4-mini", 400_000),
("gpt-5.4-nano", 400_000),
("gpt-5.4-pro", 1_050_000),
("gpt-5.5", 1_050_000),
("gpt-5.5-pro", 1_050_000),
("gpt-5.6-luna", 1_050_000),
("gpt-5.6-sol", 1_050_000),
Comment thread
michaelneale marked this conversation as resolved.
("gpt-5.6-terra", 1_050_000),
Comment on lines +65 to +67

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add canonical records before listing GPT-5.6

These IDs are only added to OPEN_AI_KNOWN_MODELS, but the refreshed inventory and session materialization paths rely on the canonical registry: fetch_recommended_models filters live /v1/models results through canonical mappings when any mapped OpenAI models exist, and with_canonical_limits uses the same registry for the session context limit. I checked rg "gpt-5\\.6|gpt-5-6" crates/goose-provider-types/src/canonical/data and there are no canonical records, so once OpenAI returns these IDs they will be dropped from refreshed recommended models; if entered manually/fallback, Goose falls back to 128k instead of the 1,050,000 limit listed here. Add matching canonical entries with the new models' limits/capabilities when exposing them.

Useful? React with 👍 / 👎.

];

pub const OPEN_AI_DOC_URL: &str = "https://platform.openai.com/docs/models";
Expand Down Expand Up @@ -839,6 +844,26 @@ mod tests {
use crate::api_client::AuthMethod;
use serde_json::json;

#[test]
fn gpt_5_5_and_5_6_models_have_expected_context_limits() {
for model in [
"gpt-5.5",
"gpt-5.5-pro",
"gpt-5.6-luna",
"gpt-5.6-sol",
"gpt-5.6-terra",
] {
assert_eq!(
OPEN_AI_KNOWN_MODELS
.iter()
.find(|(name, _)| *name == model)
.map(|(_, limit)| *limit),
Some(1_050_000),
"unexpected context limit for {model}"
);
}
}

fn make_provider(name: &str) -> OpenAiProvider {
OpenAiProvider {
api_client: ApiClient::new_with_tls(
Expand Down
Loading