mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Let the app server resolve implicit model settings for CLI forks (#43355)
## Why Client defaults can override the fork destination's model and reasoning effort or trigger a migration prompt for a stale model. ## What changed - Omit implicit model and reasoning effort overrides during CLI fork startup, while preserving explicit launch settings. - Skip the model migration prompt and service tier inference when the fork's model is left for the server to resolve. - Initialize unspecified reasoning effort from the forked session's response. ## Testing Add a startup regression test that changes server defaults after bootstrap and verifies that `thread/fork` proceeds without a migration prompt, model or reasoning effort overrides, an inferred service tier, or a `config/read` request. GitOrigin-RevId: 858f0fe3c72b90bdcaf31b400144d37af5bc6ed7
This commit is contained in:
1 parent
555b82afa9
commit
0e9589ffae
3 files changed
+151
-15
No files matched your search
@@ -218,6 +218,20 @@ impl App {
|
||||
"connected app-server platform"
|
||||
);
|
||||
let bootstrap_ms = bootstrap.duration.as_millis();
|
||||
if matches!(&session_selection, SessionSelection::Fork(_)) {
|
||||
// The app server resolves omitted overrides from the fork destination's config.
|
||||
if harness_overrides.model.is_none()
|
||||
&& !super::new_session::has_launch_setting(&config, &cli_kv_overrides, "model")
|
||||
&& !super::new_session::has_launch_setting(
|
||||
&config,
|
||||
&cli_kv_overrides,
|
||||
"model_reasoning_effort",
|
||||
)
|
||||
{
|
||||
config.model = None;
|
||||
config.model_reasoning_effort = None;
|
||||
}
|
||||
}
|
||||
let server_defaults_read = if matches!(
|
||||
&session_selection,
|
||||
SessionSelection::StartFresh | SessionSelection::Exit
|
||||
@@ -258,15 +272,20 @@ impl App {
|
||||
if let Err(err) = startup_draft.flush_pending_events(tui).await {
|
||||
return shutdown_on_startup_error(app_server, err).await;
|
||||
}
|
||||
let exit_info = handle_model_migration_prompt_if_needed(
|
||||
tui,
|
||||
&mut config,
|
||||
&local_settings,
|
||||
model.as_str(),
|
||||
&app_event_tx,
|
||||
&available_models,
|
||||
)
|
||||
.await?;
|
||||
let exit_info =
|
||||
if matches!(&session_selection, SessionSelection::Fork(_)) && config.model.is_none() {
|
||||
None
|
||||
} else {
|
||||
handle_model_migration_prompt_if_needed(
|
||||
tui,
|
||||
&mut config,
|
||||
&local_settings,
|
||||
model.as_str(),
|
||||
&app_event_tx,
|
||||
&available_models,
|
||||
)
|
||||
.await?
|
||||
};
|
||||
if let Some(exit_info) = exit_info {
|
||||
app_server
|
||||
.shutdown()
|
||||
@@ -606,6 +625,9 @@ impl App {
|
||||
{
|
||||
return shutdown_on_startup_error(app_server, err).await;
|
||||
}
|
||||
if config.model_reasoning_effort.is_none() {
|
||||
config.model_reasoning_effort = forked.session.reasoning_effort.clone();
|
||||
}
|
||||
let init = crate::chatwidget::ChatWidgetInit {
|
||||
local_settings: local_settings.clone(),
|
||||
config: config.clone(),
|
||||
|
||||
Reference in new issue
Block a user