Skip to content

Commit dca7f4c

Browse files
fix(stuff) (openai#7855)
Co-authored-by: Ahmed Ibrahim <aibrahim@openai.com>
1 parent 13c0919 commit dca7f4c

File tree

6 files changed

+134
-4
lines changed

6 files changed

+134
-4
lines changed

codex-rs/app-server/tests/suite/v2/model_list.rs

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,37 @@ async fn list_models_returns_all_models_with_large_limit() -> Result<()> {
116116
default_reasoning_effort: ReasoningEffort::Medium,
117117
is_default: false,
118118
},
119+
Model {
120+
id: "robin".to_string(),
121+
model: "robin".to_string(),
122+
display_name: "robin".to_string(),
123+
description: "Robin".to_string(),
124+
supported_reasoning_efforts: vec![
125+
ReasoningEffortOption {
126+
reasoning_effort: ReasoningEffort::Low,
127+
description: "Balances speed with some reasoning; useful for straightforward \
128+
queries and short explanations"
129+
.to_string(),
130+
},
131+
ReasoningEffortOption {
132+
reasoning_effort: ReasoningEffort::Medium,
133+
description: "Provides a solid balance of reasoning depth and latency for \
134+
general-purpose tasks"
135+
.to_string(),
136+
},
137+
ReasoningEffortOption {
138+
reasoning_effort: ReasoningEffort::High,
139+
description: "Maximizes reasoning depth for complex or ambiguous problems"
140+
.to_string(),
141+
},
142+
ReasoningEffortOption {
143+
reasoning_effort: ReasoningEffort::XHigh,
144+
description: "Extra high reasoning for complex problems".to_string(),
145+
},
146+
],
147+
default_reasoning_effort: ReasoningEffort::Medium,
148+
is_default: false,
149+
},
119150
Model {
120151
id: "gpt-5.1".to_string(),
121152
model: "gpt-5.1".to_string(),
@@ -243,8 +274,30 @@ async fn list_models_pagination_works() -> Result<()> {
243274
} = to_response::<ModelListResponse>(fourth_response)?;
244275

245276
assert_eq!(fourth_items.len(), 1);
246-
assert_eq!(fourth_items[0].id, "gpt-5.1");
247-
assert!(fourth_cursor.is_none());
277+
assert_eq!(fourth_items[0].id, "robin");
278+
let fifth_cursor = fourth_cursor.ok_or_else(|| anyhow!("cursor for fifth page"))?;
279+
280+
let fifth_request = mcp
281+
.send_list_models_request(ModelListParams {
282+
limit: Some(1),
283+
cursor: Some(fifth_cursor.clone()),
284+
})
285+
.await?;
286+
287+
let fifth_response: JSONRPCResponse = timeout(
288+
DEFAULT_TIMEOUT,
289+
mcp.read_stream_until_response_message(RequestId::Integer(fifth_request)),
290+
)
291+
.await??;
292+
293+
let ModelListResponse {
294+
data: fifth_items,
295+
next_cursor: fifth_cursor,
296+
} = to_response::<ModelListResponse>(fifth_response)?;
297+
298+
assert_eq!(fifth_items.len(), 1);
299+
assert_eq!(fifth_items[0].id, "gpt-5.1");
300+
assert!(fifth_cursor.is_none());
248301
Ok(())
249302
}
250303

codex-rs/core/src/openai_models/model_family.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ pub fn find_family_for_model(slug: &str) -> ModelFamily {
284284
truncation_policy: TruncationPolicy::Tokens(10_000),
285285
context_window: Some(CONTEXT_WINDOW_272K),
286286
)
287+
} else if slug.starts_with("robin") {
288+
model_family!(
289+
slug, slug,
290+
supports_reasoning_summaries: true,
291+
apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),
292+
support_verbosity: true,
293+
default_verbosity: Some(Verbosity::Low),
294+
base_instructions: GPT_5_1_INSTRUCTIONS.to_string(),
295+
default_reasoning_effort: Some(ReasoningEffort::Medium),
296+
truncation_policy: TruncationPolicy::Bytes(10_000),
297+
shell_type: ConfigShellToolType::ShellCommand,
298+
supports_parallel_tool_calls: true,
299+
context_window: Some(CONTEXT_WINDOW_272K),
300+
)
287301
} else if slug.starts_with("gpt-5.1") {
288302
model_family!(
289303
slug, "gpt-5.1",

codex-rs/core/src/openai_models/model_presets.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,34 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
9393
}),
9494
show_in_picker: true,
9595
},
96+
ModelPreset {
97+
id: "robin".to_string(),
98+
model: "robin".to_string(),
99+
display_name: "robin".to_string(),
100+
description: "Robin".to_string(),
101+
default_reasoning_effort: ReasoningEffort::Medium,
102+
supported_reasoning_efforts: vec![
103+
ReasoningEffortPreset {
104+
effort: ReasoningEffort::Low,
105+
description: "Balances speed with some reasoning; useful for straightforward queries and short explanations".to_string(),
106+
},
107+
ReasoningEffortPreset {
108+
effort: ReasoningEffort::Medium,
109+
description: "Provides a solid balance of reasoning depth and latency for general-purpose tasks".to_string(),
110+
},
111+
ReasoningEffortPreset {
112+
effort: ReasoningEffort::High,
113+
description: "Maximizes reasoning depth for complex or ambiguous problems".to_string(),
114+
},
115+
ReasoningEffortPreset {
116+
effort: ReasoningEffort::XHigh,
117+
description: "Extra high reasoning for complex problems".to_string(),
118+
},
119+
],
120+
is_default: false,
121+
upgrade: None,
122+
show_in_picker: true,
123+
},
96124
ModelPreset {
97125
id: "gpt-5.1".to_string(),
98126
model: "gpt-5.1".to_string(),

codex-rs/core/tests/suite/list_models.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ fn expected_models_for_api_key() -> Vec<ModelPreset> {
4646
gpt_5_1_codex_max(),
4747
gpt_5_1_codex(),
4848
gpt_5_1_codex_mini(),
49+
robin(),
4950
gpt_5_1(),
5051
]
5152
}
@@ -55,6 +56,7 @@ fn expected_models_for_chatgpt() -> Vec<ModelPreset> {
5556
gpt_5_1_codex_max(),
5657
gpt_5_1_codex(),
5758
gpt_5_1_codex_mini(),
59+
robin(),
5860
gpt_5_1(),
5961
]
6062
}
@@ -140,6 +142,37 @@ fn gpt_5_1_codex_mini() -> ModelPreset {
140142
}
141143
}
142144

145+
fn robin() -> ModelPreset {
146+
ModelPreset {
147+
id: "robin".to_string(),
148+
model: "robin".to_string(),
149+
display_name: "robin".to_string(),
150+
description: "Robin".to_string(),
151+
default_reasoning_effort: ReasoningEffort::Medium,
152+
supported_reasoning_efforts: vec![
153+
effort(
154+
ReasoningEffort::Low,
155+
"Balances speed with some reasoning; useful for straightforward queries and short explanations",
156+
),
157+
effort(
158+
ReasoningEffort::Medium,
159+
"Provides a solid balance of reasoning depth and latency for general-purpose tasks",
160+
),
161+
effort(
162+
ReasoningEffort::High,
163+
"Maximizes reasoning depth for complex or ambiguous problems",
164+
),
165+
effort(
166+
ReasoningEffort::XHigh,
167+
"Extra high reasoning for complex problems",
168+
),
169+
],
170+
is_default: false,
171+
upgrade: None,
172+
show_in_picker: true,
173+
}
174+
}
175+
143176
fn gpt_5_1() -> ModelPreset {
144177
ModelPreset {
145178
id: "gpt-5.1".to_string(),

codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ expression: popup
1010
2. gpt-5.1-codex Optimized for codex.
1111
3. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but
1212
less capable.
13-
4. gpt-5.1 Broad world knowledge with strong general
13+
4. robin Robin
14+
5. gpt-5.1 Broad world knowledge with strong general
1415
reasoning.
1516

1617
Press enter to select reasoning effort, or esc to dismiss.

codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__model_selection_popup.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ expression: popup
1010
2. gpt-5.1-codex Optimized for codex.
1111
3. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less
1212
capable.
13-
4. gpt-5.1 Broad world knowledge with strong general reasoning.
13+
4. robin Robin
14+
5. gpt-5.1 Broad world knowledge with strong general reasoning.
1415

1516
Press enter to select reasoning effort, or esc to dismiss.

0 commit comments

Comments
 (0)