Skip to content

Commit de8d772

Browse files
set gpt-5 as default model for Windows users (#4676)
Codex isn’t great yet on Windows outside of WSL, and while we’ve merged #4269 to reduce the repetitive manual approvals on readonly commands, we’ve noticed that users seem to have more issues with GPT-5-Codex than with GPT-5 on Windows. This change makes GPT-5 the default for Windows users while we continue to improve the CLI harness and model for GPT-5-Codex on Windows.
1 parent a5b7675 commit de8d772

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

codex-rs/core/src/config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ use toml_edit::DocumentMut;
4646
use toml_edit::Item as TomlItem;
4747
use toml_edit::Table as TomlTable;
4848

49-
const OPENAI_DEFAULT_MODEL: &str = "gpt-5-codex";
49+
#[cfg(target_os = "windows")]
50+
pub const OPENAI_DEFAULT_MODEL: &str = "gpt-5";
51+
#[cfg(not(target_os = "windows"))]
52+
pub const OPENAI_DEFAULT_MODEL: &str = "gpt-5-codex";
5053
const OPENAI_DEFAULT_REVIEW_MODEL: &str = "gpt-5-codex";
5154
pub const GPT_5_CODEX_MEDIUM_MODEL: &str = "gpt-5-codex";
5255

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use codex_core::NewConversation;
1717
use codex_core::built_in_model_providers;
1818
use codex_core::codex::compact::SUMMARIZATION_PROMPT;
1919
use codex_core::config::Config;
20+
use codex_core::config::OPENAI_DEFAULT_MODEL;
2021
use codex_core::protocol::ConversationPathResponseEvent;
2122
use codex_core::protocol::EventMsg;
2223
use codex_core::protocol::InputItem;
@@ -131,9 +132,10 @@ async fn compact_resume_and_fork_preserve_model_history_view() {
131132
.as_str()
132133
.unwrap_or_default()
133134
.to_string();
135+
let expected_model = OPENAI_DEFAULT_MODEL;
134136
let user_turn_1 = json!(
135137
{
136-
"model": "gpt-5-codex",
138+
"model": expected_model,
137139
"instructions": prompt,
138140
"input": [
139141
{
@@ -182,7 +184,7 @@ async fn compact_resume_and_fork_preserve_model_history_view() {
182184
});
183185
let compact_1 = json!(
184186
{
185-
"model": "gpt-5-codex",
187+
"model": expected_model,
186188
"instructions": prompt,
187189
"input": [
188190
{
@@ -251,7 +253,7 @@ async fn compact_resume_and_fork_preserve_model_history_view() {
251253
});
252254
let user_turn_2_after_compact = json!(
253255
{
254-
"model": "gpt-5-codex",
256+
"model": expected_model,
255257
"instructions": prompt,
256258
"input": [
257259
{
@@ -316,7 +318,7 @@ SUMMARY_ONLY_CONTEXT"
316318
});
317319
let usert_turn_3_after_resume = json!(
318320
{
319-
"model": "gpt-5-codex",
321+
"model": expected_model,
320322
"instructions": prompt,
321323
"input": [
322324
{
@@ -401,7 +403,7 @@ SUMMARY_ONLY_CONTEXT"
401403
});
402404
let user_turn_3_after_fork = json!(
403405
{
404-
"model": "gpt-5-codex",
406+
"model": expected_model,
405407
"instructions": prompt,
406408
"input": [
407409
{

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use codex_core::CodexAuth;
44
use codex_core::ConversationManager;
55
use codex_core::ModelProviderInfo;
66
use codex_core::built_in_model_providers;
7+
use codex_core::config::OPENAI_DEFAULT_MODEL;
78
use codex_core::model_family::find_family_for_model;
89
use codex_core::protocol::AskForApproval;
910
use codex_core::protocol::EventMsg;
@@ -18,6 +19,7 @@ use core_test_support::load_default_config_for_test;
1819
use core_test_support::load_sse_fixture_with_id;
1920
use core_test_support::skip_if_no_network;
2021
use core_test_support::wait_for_event;
22+
use std::collections::HashMap;
2123
use tempfile::TempDir;
2224
use wiremock::Mock;
2325
use wiremock::MockServer;
@@ -219,13 +221,26 @@ async fn prompt_tools_are_consistent_across_requests() {
219221

220222
// our internal implementation is responsible for keeping tools in sync
221223
// with the OpenAI schema, so we just verify the tool presence here
222-
let expected_tools_names: &[&str] = &[
223-
"shell",
224-
"update_plan",
225-
"apply_patch",
226-
"read_file",
227-
"view_image",
228-
];
224+
let tools_by_model: HashMap<&'static str, Vec<&'static str>> = HashMap::from([
225+
(
226+
"gpt-5",
227+
vec!["shell", "update_plan", "apply_patch", "view_image"],
228+
),
229+
(
230+
"gpt-5-codex",
231+
vec![
232+
"shell",
233+
"update_plan",
234+
"apply_patch",
235+
"read_file",
236+
"view_image",
237+
],
238+
),
239+
]);
240+
let expected_tools_names = tools_by_model
241+
.get(OPENAI_DEFAULT_MODEL)
242+
.unwrap_or_else(|| panic!("expected tools to be defined for model {OPENAI_DEFAULT_MODEL}"))
243+
.as_slice();
229244
let body0 = requests[0].body_json::<serde_json::Value>().unwrap();
230245
assert_eq!(
231246
body0["instructions"],

codex-rs/tui/src/chatwidget/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use codex_core::CodexAuth;
88
use codex_core::config::Config;
99
use codex_core::config::ConfigOverrides;
1010
use codex_core::config::ConfigToml;
11+
use codex_core::config::OPENAI_DEFAULT_MODEL;
1112
use codex_core::protocol::AgentMessageDeltaEvent;
1213
use codex_core::protocol::AgentMessageEvent;
1314
use codex_core::protocol::AgentReasoningDeltaEvent;
@@ -1101,6 +1102,11 @@ fn disabled_slash_command_while_task_running_snapshot() {
11011102

11021103
#[tokio::test]
11031104
async fn binary_size_transcript_snapshot() {
1105+
// the snapshot in this test depends on gpt-5-codex. Skip for now. We will consider
1106+
// creating snapshots for other models in the future.
1107+
if OPENAI_DEFAULT_MODEL != "gpt-5-codex" {
1108+
return;
1109+
}
11041110
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
11051111

11061112
// Set up a VT100 test terminal to capture ANSI visual output

0 commit comments

Comments
 (0)