app-server: centralize AuthManager initialization (#16764)

Extract a shared helper that builds AuthManager from Config and applies
the forced ChatGPT workspace override in one place.

Create the shared AuthManager at MessageProcessor call sites so that
upcoming new transport's initialization can reuse the same handle, and
keep only external auth refresher wiring inside `MessageProcessor`.

Remove the now-unused `AuthManager::shared_with_external_auth` helper.
This commit is contained in:
Ruslan Nigmatullin authored and GitHub committed 2026-04-06 12:46:55 -07:00
1 parent 46b7e4fb2c
commit 1525bbdb9a
10 files changed
+69 -48

No files matched your search

+2 -3
View File
@@ -56,10 +56,9 @@ impl MessageProcessor {
environment_manager: Arc<EnvironmentManager>,
) -> Self {
let outgoing = Arc::new(outgoing);
let auth_manager = AuthManager::shared(
config.codex_home.clone(),
let auth_manager = AuthManager::shared_from_config(
config.as_ref(),
/*enable_codex_api_key_env*/ false,
config.cli_auth_credentials_store_mode,
);
let thread_manager = Arc::new(ThreadManager::new(
config.as_ref(),