Skip to content

feat: 跳过复用旧账号开关 + 直接注册与 OAuth 登录鲁棒性优化#60

Open
ef4tless wants to merge 4 commits into
cnitlrt:devfrom
ef4tless:feature/skip-standby-reuse
Open

feat: 跳过复用旧账号开关 + 直接注册与 OAuth 登录鲁棒性优化#60
ef4tless wants to merge 4 commits into
cnitlrt:devfrom
ef4tless:feature/skip-standby-reuse

Conversation

@ef4tless

Copy link
Copy Markdown

概述

本 PR 打包了针对自动轮转流程的四项相关改进:

  1. 新增跳过复用旧账号开关
    在巡检设置里新增开关 AUTO_CHECK_SKIP_STANDBY_REUSE
    开启后轮转跳过 standby 账号复用阶段,
    直接注册新账号。覆盖主轮转循环和 seat=2 预切换两个路径。

  2. 修复直接注册的验证码录入检测
    选择器扩充为现代 OpenAI 邮箱验证页的
    input[autocomplete=\"one-time-code\"]inputmode=\"numeric\"
    以及 6 格分离型表单。
    在验证码阶段 polling 等到 15s,
    找不到时输出明确 warning 加截图,
    代替之前静默跳过后陷入 3 × 60s 重试与浏览器闪烁的问题。

  3. OAuth 登录阶段进度日志
    在 chatgpt.com 登录交接阶段(页面加载、
    Cloudflare 等待/通过、点登录、提交邮箱、提交密码)
    增加阶段日志,让原本静默的 60s+ 间隔可观察。

  4. no_valid_organizations 识别与重试
    URL/body 中出现该错误时归类为可重试失败,
    _login_codex_with_result 重试前睡 5s 让 server 侧准备;
    同时把 /api/tasks/login 接口改为走该重试包装器,
    手动登录任务也能复用同一套逻辑。

测试计划

  • uv run ruff check . (本地已过)
  • uv run ruff format --check . (本地已过)
  • uv run python -m compileall -q src/autoteam (本地已过)
  • 手动:巡检设置开启「跳过复用旧账号」后触发轮转,确认日志出现【已开启"跳过复用旧账号"】,standby 循环被跳过
  • 手动:创建新账号,验证码页被识别并自动填入
  • 手动:触发一个会命中 no_valid_organizations 的登录任务,确认 5s 等待 + 重试日志出现

🤖 Generated with Claude Code

ef4tless and others added 4 commits May 24, 2026 14:39
Allow rotation to bypass standby reuse and register new accounts directly.
Exposed as a toggle in the web inspection settings; persisted via
AUTO_CHECK_SKIP_STANDBY_REUSE and applied in both the main rotate loop
and seat=2 preswitch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Direct registration used to silently skip the verification code step
when OpenAI's email-verification page presented anything other than a
classic input[name="code"] field, leaving the account stuck on the
verification URL until the 3-attempt retry exhausted and the browser
visibly flashed open/close each cycle.

Expand _DIRECT_CODE_SELECTORS to cover input[inputmode="numeric"] and
input[autocomplete="one-time-code"], introduce _DIRECT_CODE_SLOT_SELECTORS
for the split 6-digit form, poll up to 15s when current_step == "code",
and abort with a clear warning + screenshot when no input shape matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three related improvements to make Codex OAuth login on freshly
registered accounts more observable and more resilient:

- codex_auth: emit phased progress logs through the ChatGPT login
  hand-off (page load, Cloudflare wait/pass, login button, email
  submit, password submit) so long sleeps no longer feel like hangs;
  classify "no_valid_organizations" (URL or body) as a retryable
  failure with a dedicated label.

- manager: surface the new error type via _auth_repair_error_label,
  and add a 5s cool-off inside _login_codex_with_result before the
  next attempt when the previous attempt hit no_valid_organizations.

- api: route /api/tasks/login through _login_codex_with_result so the
  manual login task picks up the same retry logic, and propagate the
  failure detail in the RuntimeError message.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pure ruff check --fix + ruff format output covering the previous three
commits (import ordering in api.py, line-wrap in config.py, single-line
collapse in manager.py). No behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant