make model optional in config (#7769)

- Make Config.model optional and centralize default-selection logic in
ModelsManager, including a default_model helper (with
codex-auto-balanced when available) so sessions now carry an explicit
chosen model separate from the base config.
- Resolve `model` once in `core` and `tui` from config. Then store the
state of it on other structs.
- Move refreshing models to be before resolving the default model
This commit is contained in:
Ahmed Ibrahim
2025-12-10 11:19:00 -08:00
committed by GitHub
parent 8a71f8b634
commit cb9a189857
44 changed files with 838 additions and 429 deletions

View File

@@ -17,7 +17,7 @@ fn normalize_agents_display_path(path: &Path) -> String {
}
pub(crate) fn compose_model_display(
config: &Config,
model_name: &str,
entries: &[(&str, String)],
) -> (String, Vec<String>) {
let mut details: Vec<String> = Vec::new();
@@ -33,7 +33,7 @@ pub(crate) fn compose_model_display(
}
}
(config.model.clone(), details)
(model_name.to_string(), details)
}
pub(crate) fn compose_agents_summary(config: &Config) -> String {