Stop using AuthManager as the source of codex_home (#8846)

This commit is contained in:
pakrym-oai
2026-01-07 10:56:20 -08:00
committed by GitHub
parent c31960b13a
commit 018de994b0
13 changed files with 79 additions and 47 deletions

View File

@@ -366,6 +366,7 @@ async fn make_chatwidget_manual(
skills: None,
});
let auth_manager = AuthManager::from_auth_for_testing(CodexAuth::from_api_key("test"));
let codex_home = cfg.codex_home.clone();
let widget = ChatWidget {
app_event_tx,
codex_op_tx: op_tx,
@@ -374,7 +375,7 @@ async fn make_chatwidget_manual(
config: cfg,
model: resolved_model.clone(),
auth_manager: auth_manager.clone(),
models_manager: Arc::new(ModelsManager::new(auth_manager)),
models_manager: Arc::new(ModelsManager::new(codex_home, auth_manager)),
session_header: SessionHeader::new(resolved_model),
initial_user_message: None,
token_info: None,
@@ -415,7 +416,10 @@ async fn make_chatwidget_manual(
fn set_chatgpt_auth(chat: &mut ChatWidget) {
chat.auth_manager =
AuthManager::from_auth_for_testing(CodexAuth::create_dummy_chatgpt_auth_for_testing());
chat.models_manager = Arc::new(ModelsManager::new(chat.auth_manager.clone()));
chat.models_manager = Arc::new(ModelsManager::new(
chat.config.codex_home.clone(),
chat.auth_manager.clone(),
));
}
pub(crate) async fn make_chatwidget_manual_with_sender() -> (