From 79afd6315dc2a26b5f57a108383830e112a5b9ca Mon Sep 17 00:00:00 2001 From: EricPrometheus Date: Mon, 18 May 2026 18:12:48 +0800 Subject: [PATCH] fix: main codex login fallback to password when OTP unavailable - Add password auto-fill fallback when OTP switch fails on Codex OAuth page - Pass saved admin password to MainCodexLoginFlow instead of empty string --- src/autoteam/codex_auth.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/autoteam/codex_auth.py b/src/autoteam/codex_auth.py index c61fa592..1f6eb516 100644 --- a/src/autoteam/codex_auth.py +++ b/src/autoteam/codex_auth.py @@ -1528,6 +1528,8 @@ def _advance(self, attempts=12): if step == "password_required": if self._switch_password_to_otp(): continue + if self._auto_fill_password(): + continue return { "step": "unsupported_password", "detail": "主号 Codex 当前停留在密码页,且未找到一次性验证码入口", @@ -1618,12 +1620,14 @@ def stop(self): class MainCodexLoginFlow(SessionCodexAuthFlow): def __init__(self): + from autoteam.admin_state import get_admin_password + super().__init__( email=get_admin_email(), session_token=get_admin_session_token(), account_id=get_chatgpt_account_id(), workspace_name=get_chatgpt_workspace_name(), - password="", + password=get_admin_password(), password_callback=None, auth_file_callback=save_main_auth_file, )