From e31301a585307834aa5c928ff275a70bc9aafcfd Mon Sep 17 00:00:00 2001 From: rreichel3-oai Date: Mon, 4 May 2026 11:43:01 -0400 Subject: [PATCH] Fix rebased login tests codex-rs/login/src/auth/auth_tests.rs: drop a stale auth-manager watcher test that no longer matches the main-branch API. codex-rs/login/tests/suite/device_code_login.rs: pass the current ServerOptions::new streamlined-login argument. --- codex-rs/login/src/auth/auth_tests.rs | 61 ------------------- .../login/tests/suite/device_code_login.rs | 1 + 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/codex-rs/login/src/auth/auth_tests.rs b/codex-rs/login/src/auth/auth_tests.rs index d88a1eca99..4b46b8c0a4 100644 --- a/codex-rs/login/src/auth/auth_tests.rs +++ b/codex-rs/login/src/auth/auth_tests.rs @@ -592,67 +592,6 @@ exit 1 } } -#[tokio::test] -async fn auth_manager_notifies_when_auth_state_changes() { - let dir = tempdir().unwrap(); - let manager = AuthManager::shared( - dir.path().to_path_buf(), - /*enable_codex_api_key_env*/ false, - AuthCredentialsStoreMode::File, - ); - let mut auth_state_rx = manager.subscribe_auth_state(); - - save_auth( - dir.path(), - &AuthDotJson { - auth_mode: Some(ApiAuthMode::ApiKey), - openai_api_key: Some("sk-test-key".to_string()), - tokens: None, - last_refresh: None, - agent_identity: None, - }, - AuthCredentialsStoreMode::File, - ) - .expect("save auth"); - - assert!( - manager.reload(), - "reload should report a changed auth state" - ); - timeout(Duration::from_secs(1), auth_state_rx.changed()) - .await - .expect("auth change notification should arrive") - .expect("auth state watch should remain open"); - - save_auth( - dir.path(), - &AuthDotJson { - auth_mode: Some(ApiAuthMode::ApiKey), - openai_api_key: Some("sk-updated-key".to_string()), - tokens: None, - last_refresh: None, - agent_identity: None, - }, - AuthCredentialsStoreMode::File, - ) - .expect("save updated auth"); - - assert!( - !manager.reload(), - "reload remains mode-stable even when the underlying credentials change" - ); - timeout(Duration::from_secs(1), auth_state_rx.changed()) - .await - .expect("auth reload notification should still arrive") - .expect("auth state watch should remain open"); - - manager.set_forced_chatgpt_workspace_id(Some(vec!["workspace-123".to_string()])); - timeout(Duration::from_secs(1), auth_state_rx.changed()) - .await - .expect("workspace change notification should arrive") - .expect("auth state watch should remain open"); -} - struct AuthFileParams { openai_api_key: Option, chatgpt_plan_type: Option, diff --git a/codex-rs/login/tests/suite/device_code_login.rs b/codex-rs/login/tests/suite/device_code_login.rs index 234acd3a43..c957eac310 100644 --- a/codex-rs/login/tests/suite/device_code_login.rs +++ b/codex-rs/login/tests/suite/device_code_login.rs @@ -106,6 +106,7 @@ fn server_opts( codex_home.path().to_path_buf(), "client-id".to_string(), /*forced_chatgpt_workspace_id*/ None, + /*codex_streamlined_login*/ false, cli_auth_credentials_store_mode, ); opts.issuer = issuer;