mirror of
https://github.com/openai/codex.git
synced 2026-11-22 23:00:42 +00:00
test fixes after rebase
This commit is contained in:
@@ -460,7 +460,8 @@
|
||||
"type": "string"
|
||||
},
|
||||
"ModelInfoPatch": {
|
||||
"description": "User-provided patch for overriding model metadata in local config.\n\nEvery field is optional so users can override only the parts they need. The target model slug is provided by the surrounding map key.",
|
||||
"additionalProperties": false,
|
||||
"description": "User-provided patch for overriding model metadata in local config.\n\nEvery field is optional so users can override only the parts of [`ModelInfo`] they need. The target model slug is provided by the surrounding map key.",
|
||||
"properties": {
|
||||
"apply_patch_tool_type": {
|
||||
"allOf": [
|
||||
|
||||
@@ -385,7 +385,10 @@ impl ModelsManager {
|
||||
///
|
||||
/// This follows the same override precedence as `get_model_info`:
|
||||
/// per-model `model_info_overrides` are applied first, then top-level config overrides.
|
||||
pub(crate) fn construct_model_info_offline_for_tests(model: &str, config: &Config) -> ModelInfo {
|
||||
pub(crate) fn construct_model_info_offline_for_tests(
|
||||
model: &str,
|
||||
config: &Config,
|
||||
) -> ModelInfo {
|
||||
let model_info = model_info::model_info_from_slug(model);
|
||||
let model_info = model_info::with_model_info_patches(model_info, model, config);
|
||||
model_info::with_config_overrides(model_info, config)
|
||||
|
||||
@@ -9,6 +9,7 @@ use codex_core::Prompt;
|
||||
use codex_core::ResponseEvent;
|
||||
use codex_core::ResponseItem;
|
||||
use codex_core::WireApi;
|
||||
use codex_core::models_manager::manager::ModelsManager;
|
||||
use codex_otel::OtelManager;
|
||||
use codex_otel::TelemetryAuthMode;
|
||||
use codex_protocol::ThreadId;
|
||||
@@ -403,7 +404,8 @@ async fn responses_respects_model_info_overrides_from_config() {
|
||||
let effort = config.model_reasoning_effort;
|
||||
let summary = config.model_reasoning_summary;
|
||||
let model = config.model.clone().expect("model configured");
|
||||
let auth_manager = AuthManager::from_auth_for_testing(CodexAuth::from_api_key("Test API Key"));
|
||||
let auth_manager =
|
||||
codex_core::test_support::auth_manager_from_auth(CodexAuth::from_api_key("Test API Key"));
|
||||
let auth_mode = auth_manager.auth_mode().map(TelemetryAuthMode::from);
|
||||
let models_manager = ModelsManager::new(config.codex_home.clone(), auth_manager);
|
||||
let config = Arc::new(config);
|
||||
|
||||
@@ -52,7 +52,7 @@ async fn model_info_patch_applies_for_fallback_and_prefix_resolution_paths() {
|
||||
let codex_home = TempDir::new().expect("create temp dir");
|
||||
let mut config = load_default_config_for_test(&codex_home).await;
|
||||
config.features.enable(Feature::RemoteModels);
|
||||
let auth_manager = codex_core::AuthManager::from_auth_for_testing(
|
||||
let auth_manager = codex_core::test_support::auth_manager_from_auth(
|
||||
CodexAuth::create_dummy_chatgpt_auth_for_testing(),
|
||||
);
|
||||
let manager = ModelsManager::new(config.codex_home.clone(), auth_manager);
|
||||
|
||||
Reference in New Issue
Block a user