chores: models manager (#7937)

This commit is contained in:
Ahmed Ibrahim
2025-12-12 10:59:39 -08:00
committed by GitHub
parent b3ddd50eee
commit 149696d959
4 changed files with 6 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ assert_cmd = { workspace = true }
base64 = { workspace = true }
chrono = { workspace = true }
codex-app-server-protocol = { workspace = true }
codex-core = { workspace = true }
codex-core = { workspace = true, features = ["test-support"] }
codex-protocol = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

View File

@@ -58,7 +58,6 @@ pub enum SandboxErr {
#[derive(Error, Debug)]
pub enum CodexErr {
// todo(aibrahim): git rid of this error carrying the dangling artifacts
#[error("turn aborted. Something went wrong? Hit `/feedback` to report the issue.")]
TurnAborted,

View File

@@ -83,7 +83,7 @@ pub struct ModelFamily {
}
impl ModelFamily {
pub fn with_config_overrides(mut self, config: &Config) -> Self {
pub(super) fn with_config_overrides(mut self, config: &Config) -> Self {
if let Some(supports_reasoning_summaries) = config.model_supports_reasoning_summaries {
self.supports_reasoning_summaries = supports_reasoning_summaries;
}
@@ -98,7 +98,7 @@ impl ModelFamily {
}
self
}
pub fn with_remote_overrides(mut self, remote_models: Vec<ModelInfo>) -> Self {
pub(super) fn with_remote_overrides(mut self, remote_models: Vec<ModelInfo>) -> Self {
for model in remote_models {
if model.slug == self.slug {
self.apply_remote_overrides(model);
@@ -198,7 +198,7 @@ macro_rules! model_family {
/// Internal offline helper for `ModelsManager` that returns a `ModelFamily` for the given
/// model slug.
pub(in crate::openai_models) fn find_family_for_model(slug: &str) -> ModelFamily {
pub(super) fn find_family_for_model(slug: &str) -> ModelFamily {
if slug.starts_with("o3") {
model_family!(
slug, "o3",

View File

@@ -237,7 +237,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
]
});
pub(crate) fn builtin_model_presets(_auth_mode: Option<AuthMode>) -> Vec<ModelPreset> {
pub(super) fn builtin_model_presets(_auth_mode: Option<AuthMode>) -> Vec<ModelPreset> {
PRESETS
.iter()
.filter(|preset| preset.show_in_picker)
@@ -245,7 +245,7 @@ pub(crate) fn builtin_model_presets(_auth_mode: Option<AuthMode>) -> Vec<ModelPr
.collect()
}
// todo(aibrahim): remove this once we migrate tests
#[cfg(any(test, feature = "test-support"))]
pub fn all_model_presets() -> &'static Vec<ModelPreset> {
&PRESETS
}