From dca7f4cb60fa6cdebb5c71e1b71c628c0773effb Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Thu, 11 Dec 2025 00:39:47 -0800 Subject: [PATCH] fix(stuff) (#7855) Co-authored-by: Ahmed Ibrahim --- .../app-server/tests/suite/v2/model_list.rs | 57 ++++++++++++++++++- .../core/src/openai_models/model_family.rs | 14 +++++ .../core/src/openai_models/model_presets.rs | 28 +++++++++ codex-rs/core/tests/suite/list_models.rs | 33 +++++++++++ ...twidget__tests__model_selection_popup.snap | 3 +- ...twidget__tests__model_selection_popup.snap | 3 +- 6 files changed, 134 insertions(+), 4 deletions(-) diff --git a/codex-rs/app-server/tests/suite/v2/model_list.rs b/codex-rs/app-server/tests/suite/v2/model_list.rs index 0e0f607e2..e8d3d1605 100644 --- a/codex-rs/app-server/tests/suite/v2/model_list.rs +++ b/codex-rs/app-server/tests/suite/v2/model_list.rs @@ -116,6 +116,37 @@ async fn list_models_returns_all_models_with_large_limit() -> Result<()> { default_reasoning_effort: ReasoningEffort::Medium, is_default: false, }, + Model { + id: "robin".to_string(), + model: "robin".to_string(), + display_name: "robin".to_string(), + description: "Robin".to_string(), + supported_reasoning_efforts: vec![ + ReasoningEffortOption { + reasoning_effort: ReasoningEffort::Low, + description: "Balances speed with some reasoning; useful for straightforward \ + queries and short explanations" + .to_string(), + }, + ReasoningEffortOption { + reasoning_effort: ReasoningEffort::Medium, + description: "Provides a solid balance of reasoning depth and latency for \ + general-purpose tasks" + .to_string(), + }, + ReasoningEffortOption { + reasoning_effort: ReasoningEffort::High, + description: "Maximizes reasoning depth for complex or ambiguous problems" + .to_string(), + }, + ReasoningEffortOption { + reasoning_effort: ReasoningEffort::XHigh, + description: "Extra high reasoning for complex problems".to_string(), + }, + ], + default_reasoning_effort: ReasoningEffort::Medium, + is_default: false, + }, Model { id: "gpt-5.1".to_string(), model: "gpt-5.1".to_string(), @@ -243,8 +274,30 @@ async fn list_models_pagination_works() -> Result<()> { } = to_response::(fourth_response)?; assert_eq!(fourth_items.len(), 1); - assert_eq!(fourth_items[0].id, "gpt-5.1"); - assert!(fourth_cursor.is_none()); + assert_eq!(fourth_items[0].id, "robin"); + let fifth_cursor = fourth_cursor.ok_or_else(|| anyhow!("cursor for fifth page"))?; + + let fifth_request = mcp + .send_list_models_request(ModelListParams { + limit: Some(1), + cursor: Some(fifth_cursor.clone()), + }) + .await?; + + let fifth_response: JSONRPCResponse = timeout( + DEFAULT_TIMEOUT, + mcp.read_stream_until_response_message(RequestId::Integer(fifth_request)), + ) + .await??; + + let ModelListResponse { + data: fifth_items, + next_cursor: fifth_cursor, + } = to_response::(fifth_response)?; + + assert_eq!(fifth_items.len(), 1); + assert_eq!(fifth_items[0].id, "gpt-5.1"); + assert!(fifth_cursor.is_none()); Ok(()) } diff --git a/codex-rs/core/src/openai_models/model_family.rs b/codex-rs/core/src/openai_models/model_family.rs index 2cc6fd084..87ea6a4fc 100644 --- a/codex-rs/core/src/openai_models/model_family.rs +++ b/codex-rs/core/src/openai_models/model_family.rs @@ -284,6 +284,20 @@ pub fn find_family_for_model(slug: &str) -> ModelFamily { truncation_policy: TruncationPolicy::Tokens(10_000), context_window: Some(CONTEXT_WINDOW_272K), ) + } else if slug.starts_with("robin") { + model_family!( + slug, slug, + supports_reasoning_summaries: true, + apply_patch_tool_type: Some(ApplyPatchToolType::Freeform), + support_verbosity: true, + default_verbosity: Some(Verbosity::Low), + base_instructions: GPT_5_1_INSTRUCTIONS.to_string(), + default_reasoning_effort: Some(ReasoningEffort::Medium), + truncation_policy: TruncationPolicy::Bytes(10_000), + shell_type: ConfigShellToolType::ShellCommand, + supports_parallel_tool_calls: true, + context_window: Some(CONTEXT_WINDOW_272K), + ) } else if slug.starts_with("gpt-5.1") { model_family!( slug, "gpt-5.1", diff --git a/codex-rs/core/src/openai_models/model_presets.rs b/codex-rs/core/src/openai_models/model_presets.rs index 6c0046569..b279a33fc 100644 --- a/codex-rs/core/src/openai_models/model_presets.rs +++ b/codex-rs/core/src/openai_models/model_presets.rs @@ -93,6 +93,34 @@ static PRESETS: Lazy> = Lazy::new(|| { }), show_in_picker: true, }, + ModelPreset { + id: "robin".to_string(), + model: "robin".to_string(), + display_name: "robin".to_string(), + description: "Robin".to_string(), + default_reasoning_effort: ReasoningEffort::Medium, + supported_reasoning_efforts: vec![ + ReasoningEffortPreset { + effort: ReasoningEffort::Low, + description: "Balances speed with some reasoning; useful for straightforward queries and short explanations".to_string(), + }, + ReasoningEffortPreset { + effort: ReasoningEffort::Medium, + description: "Provides a solid balance of reasoning depth and latency for general-purpose tasks".to_string(), + }, + ReasoningEffortPreset { + effort: ReasoningEffort::High, + description: "Maximizes reasoning depth for complex or ambiguous problems".to_string(), + }, + ReasoningEffortPreset { + effort: ReasoningEffort::XHigh, + description: "Extra high reasoning for complex problems".to_string(), + }, + ], + is_default: false, + upgrade: None, + show_in_picker: true, + }, ModelPreset { id: "gpt-5.1".to_string(), model: "gpt-5.1".to_string(), diff --git a/codex-rs/core/tests/suite/list_models.rs b/codex-rs/core/tests/suite/list_models.rs index 70df5174f..268115bb5 100644 --- a/codex-rs/core/tests/suite/list_models.rs +++ b/codex-rs/core/tests/suite/list_models.rs @@ -46,6 +46,7 @@ fn expected_models_for_api_key() -> Vec { gpt_5_1_codex_max(), gpt_5_1_codex(), gpt_5_1_codex_mini(), + robin(), gpt_5_1(), ] } @@ -55,6 +56,7 @@ fn expected_models_for_chatgpt() -> Vec { gpt_5_1_codex_max(), gpt_5_1_codex(), gpt_5_1_codex_mini(), + robin(), gpt_5_1(), ] } @@ -140,6 +142,37 @@ fn gpt_5_1_codex_mini() -> ModelPreset { } } +fn robin() -> ModelPreset { + ModelPreset { + id: "robin".to_string(), + model: "robin".to_string(), + display_name: "robin".to_string(), + description: "Robin".to_string(), + default_reasoning_effort: ReasoningEffort::Medium, + supported_reasoning_efforts: vec![ + effort( + ReasoningEffort::Low, + "Balances speed with some reasoning; useful for straightforward queries and short explanations", + ), + effort( + ReasoningEffort::Medium, + "Provides a solid balance of reasoning depth and latency for general-purpose tasks", + ), + effort( + ReasoningEffort::High, + "Maximizes reasoning depth for complex or ambiguous problems", + ), + effort( + ReasoningEffort::XHigh, + "Extra high reasoning for complex problems", + ), + ], + is_default: false, + upgrade: None, + show_in_picker: true, + } +} + fn gpt_5_1() -> ModelPreset { ModelPreset { id: "gpt-5.1".to_string(), diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap index a7a1c5651..b4c76500c 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap @@ -10,7 +10,8 @@ expression: popup 2. gpt-5.1-codex Optimized for codex. 3. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less capable. - 4. gpt-5.1 Broad world knowledge with strong general + 4. robin Robin + 5. gpt-5.1 Broad world knowledge with strong general reasoning. Press enter to select reasoning effort, or esc to dismiss. diff --git a/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__model_selection_popup.snap b/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__model_selection_popup.snap index 3937194a1..b0482e7ec 100644 --- a/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__model_selection_popup.snap +++ b/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__model_selection_popup.snap @@ -10,6 +10,7 @@ expression: popup 2. gpt-5.1-codex Optimized for codex. 3. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less capable. - 4. gpt-5.1 Broad world knowledge with strong general reasoning. + 4. robin Robin + 5. gpt-5.1 Broad world knowledge with strong general reasoning. Press enter to select reasoning effort, or esc to dismiss.