Spaces:
Paused
Paused
Commit History
-
feat: /api/tasks/oauth-fill endpoint + auto-check oauth_first wiring
Verified signaturea66b0f1 -
feat: oauth_first mode accepted in setup api
Verified signature2f502eb
-
fix: align protected seat rotation semantics
25aa943
-
fix: align provider auth seat semantics
c73b0b0
-
fix: reduce rotation probe interference
be34853 -
fix: sync rotation account creation strategy
120638a -
fix: complete autoteam-1 parity migration
ceeba19
-
fix: harden seat rotation and direct signup race
05bf6da
-
feat: add multi-master Team fill scheduler
ead7e93 -
fix: 对齐注册轮转链路和 CloudMail 配置提示
5aff1af
-
feat: AutoTeam 大版本升级:安全轮换、并行、IPv6、指纹加固与前端重构
- 安全轮换逻辑:先踢人再换人,降低轮转冲突和失败回弹 - 并行能力:同步、注册与目标分发链路并发化,整体吞吐更高 - IPv6 支持:接入 IPv6 代理池与状态面,扩展可用出口 - 更安全的指纹:统一浏览器上下文与启动/会话参数,减少特征暴露 - 轮转增强:速度与安全性双提升,轮转后凭证即时同步到配置目标 - 更好的前端:Dashboard / Settings / Sync / Task 视图全面重构,实时性、信息密度和可读性提升 - 同步与诊断:统一 sync_targets 分发层,增强主号、注册和轮转后的诊断与目标同步1f4cfcb -
feat: add ipv6 proxy pool and status surface
8543971
-
fix: harden Playwright and HTTP transport cleanup
a011d67 -
Harden AutoTeam runtime and free registration
90694b4
-
fix(round-12): wire up dead helpers + integration fixes (per audit reports)
Audit (research/review-integration.md + review-deep.md) found that round-12 landed helpers but never wired them into the production call path. This commit closes the loop: Critical - C1: _record_auth_repair_failure + _auth_repair_skip_reason + _auth_repair_reset now fire from reinvite_account 4 failure paths (no_bundle / plan_drift / plan_unsupported / oauth_phone_blocked), the success path resets state, and _reuse_one_standby skips accounts in auth_repair cooldown / paused. - C2: apply_pool_health_signal now fires from master_health.py:733 (_apply_master_degraded_classification) and api.py master-health endpoint, so 3 consecutive unhealthy probes trigger pool failover. - C3: cmd_rotate auto-downgrades ROTATE_CONCURRENCY>1 to serial (Playwright sync_api is not thread-safe across BrowserContexts). Comment corrected. Opt-out via ROTATE_CONCURRENCY_ALLOW_BROWSER_RACE=1 for mocked tests. Major - M1: sync_account_states 9 direct status writes routed through update_account …70a6b78 -
feat(round-12 F2+F3): rotate progress SSE + refresh polish + settings cleanup
后端: - /api/rotate/stream FastAPI StreamingResponse SSE 端点,订阅 S1 default_machine.subscribe 事件总线,把 transition 序列化为 data: {email, from, to, reason, ts, extra}\n\n - _build_sse_event_stream(machine, heartbeat_seconds=15) 抽出可单测的 sync generator;queue.SimpleQueue 中转 callback → generator,线程安全; try/finally 确保 generator 关闭时 unsubscribe (无订阅泄漏) - 心跳:queue.get(timeout=15) 触发 ': heartbeat\n\n' 注释行 - response headers: Cache-Control: no-cache + X-Accel-Buffering: no - 5 个单测覆盖:retry/connected 头、data event payload、heartbeat、 generator close → unsubscribe、extra 字段透传 前端: - web/src/composables/useRotateStream.js 新建,EventSource 包装, 暴露 events (max 50, 倒序) + isConnected + connect/disconnect + onTransition(cb);连续 5 次重连失败后 stop - useStatus.js 新增 useStatusQuery (vue-query 30s polling + refetchOnWindowFocus + keepPreviousData) + useStatusInvalidator (SSE event → invalidateQueries(['status']));原 21 套 utility 函数全保留,21 个组件 import 不破 - TaskPanel.vue 集成实时进度折叠面板:Activity/Check/AlertTriangle Luci…5db48a2
-
feat(round-11): master grace healthy + 子号实时探活 + smoke model + ⚠️ 免费号注册路径被 OpenAI 阻断
后端核心: - master_health._classify_l1 加 id_token 参数,从 codex-main-*.json 读 admin id_token, eligible_for_auto_reactivation=true 时分 grace_until 两支:grace 期内 → (True, "subscription_grace"), 否则 → (False, "subscription_cancelled"). M-I3 守卫扩 healthy_reasons=("active","subscription_grace"), 撤回路径触发条件同步扩展. - cheap_codex_smoke 加 model + max_output_tokens 参数,读完整 SSE 流到 response.completed, 返回 dict 含 response_text + raw_event + tokens 替代旧 str. - api.py 新增 POST /api/accounts/{email}/probe(并行 quota+smoke 不动 status, RT-I1) + GET /api/accounts/{email}/models. - chatgpt_api._api_fetch header sanitize: ISO-8859-1 round-trip + None skip + bytes decode + warning 诊断 (实测过程中发现的 admin 重登路径 P0 阻塞修复). 前端: useStatus.masterHealthSeverity grace→warning;MasterHealthBanner/PoolHealthCard grace 黄色 + 倒计时;Dashboard 每行"立即探活"按钮 + toast 三态. 测试: Round 11 新增 26 cases(8 grace + 6 smoke + 8 probe + 4 header sanitize), pytest tests/unit -q → 256 passed,ruff check → All checks passed. Spec: master-subscription-health v…090976a
-
feat(round-9): GRACE 状态机 + retroactive helper 5 触发点 + 前端 UI/UX 美化整套
修复 Round 8 留下的 retroactive 触发点空洞 + grace period 配额损失问题: 研究证实母号 b328bd37 处于 cancel_at_period_end 状态(grace 期至 2026-05-25T12:06:23Z), 4 个 xsuuhfn wham=200 plan=team 仍可用,Round 8 spec "立刻标 standby" 会损失配额。 状态错误根因:_reconcile_master_degraded_subaccounts 只挂 cmd_reconcile,server 重启 / sync / 巡检都不触发 retroactive 重分类。 Approach B — STATUS_DEGRADED_GRACE 状态机 + 5 触发点 helper + 前端 UI/UX 重做: 后端(B1~B5) - accounts.py 新增 STATUS_DEGRADED_GRACE 状态 + grace_until 字段持久化 - master_health.py 新增 extract_grace_until_from_jwt() 解析 subscription_active_until - master_health.py 新增 _apply_master_degraded_classification helper(永不抛、永不被 KICK) - 5 retroactive 触发点接入(RT-1 lifespan / RT-2 _auto_check_loop / RT-3 reconcile_team / RT-4 sync_account_states / RT-5 cmd_rotate)+ 现有 cmd_reconcile RT-6 - api.py /api/admin/master-health 三层 try/except 兜底,任何场景永不 5xx(M-I1 守恒) - api.py:fill_*_task Team 分支补 master probe 503 fail-fast(对称 personal,Round 8 P1-1) 前端(F1~F6)— 9 新组件 + 11 重写 - F1 实际可用列(UsabilityCell.vue):基于 status + last_quota + …395e9dc -
feat(round-8): master 订阅探针 + OAuth Personal Workspace 显式选 + 5 次重试
修复两层耦合根因(母号 ChatGPT Team 订阅过期 + OAuth sticky default_workspace_id): 研究证实根因不是 OpenAI sticky-rejoin,而是 auth.openai.com 的 default_workspace_id 不随 ChatGPT DELETE user 联动,导致 personal OAuth 默认仍颁 plan_type=team token。 sleep(8) 等再久也无意义。28 条 register_failures plan_drift 来源于此。 Approach A 全栈三层 + 边缘清理: L1 — master subscription 探针(src/autoteam/master_health.py 新模块) - is_master_subscription_healthy() 三层探针:eligible_for_auto_reactivation(主) + plan_type 反推(corroborating) + /settings.plan(safety net) - 5min cache schema_version=1,落 accounts/.master_health_cache.json - 7 类返回(healthy / degraded / cancelled / network_error / ...) - /api/admin/diagnose 嵌入 master_subscription_state + 新增 /api/admin/master-health L2 — OAuth Personal Workspace 显式选号(src/autoteam/oauth_workspace.py 新模块) - decode/select/UI fallback/ensure 四件套:HTTP POST workspace/select 主路径 + Playwright UI fallback(401 自动降级),覆盖 oai-oauth-session 解码场景 - codex_auth.py login_codex_via_browser(use_personal=True) consent loop 后调 ensure_personal…e6cc775
-
fix(round-7): P2 收尾 + Round 6 deferred — 命名/抽组件/lifespan/24h去重/409/state-machine
P2 收尾 (来自 wave1-4 integration-verifier 5 项): - preferred_seat_type 命名归一化:chatgpt 别名 → default,setter/getter 双向兼容(runtime_config.py) - MailProviderCard.vue 抽出共享组件:Settings.vue / SetupPage.vue 各减约 200 行,统一邮箱归属验证 UI - test_plan_type_whitelist.py 拆分:从 test_spec2_lifecycle.py 移出 plan_type 白名单测试到独立文件 - FastAPI lifespan 迁移:on_event("startup"/"shutdown") → @asynccontextmanager(api.py),消除 DeprecationWarning - raw_rate_limit 注入 register_failures:codex_auth.py / manager.py 3 处 record_failure 调用点添加原始 wham/usage payload Round 6 deferred (来自 round6-review 推迟项): - manager 24h 去重 cheap_codex_smoke:last_codex_smoke_at / last_smoke_result 缓存,避免重复探测 - 前端 parseTaskError:web/src/api.js 导出辅助函数,解析 phone_required / register_blocked 409 响应 - shared/account-state-machine.md v1.0 → v1.1:补转移矩阵小注 文档同步: - spec/shared/account-state-machine.md v1.0 → v1.1 - spec/shared/quota-classification.md v1.3 → v1.4 - spec/spec-1-mail-provider.md v1.0 → v1.1 - spec/spec-2-account-lifecycle.md v1.3 → v1.4 - prompts/0426/prd/prd…a4ea50b -
fix(round-6): P0 半空载漏判 + 4 P1 探针/短路/409 — 完整流程修复
Round 5 验证团队(integration-verifier + production-cleaner)在 Wave 4 commit 478c16c 基础上做集成审查 + 旧账号实测,揭示 1 P0 + 4 P1 偏差。本轮(Round 6)按完整流程 (调研→分析→PRD→SPEC→开发→测试→审查→完成)修复。 ## P0 修复 — issue#6 半空载漏判残余 (codex_auth.py) Round 5 实测 4 个 @xsuuhfn.cloud active 号 wham/usage 返回: primary_total=null + primary_resets_at>0 + primary_pct=0 + primary_remaining=null 现有 3 条 no_quota 触发都不命中 → 落 ok 分支。fresh seat 半空载漏判。 修复: 1. get_quota_exhausted_info 加 I5 条款("workspace_uninitialized" 信号) 2. 新增 cheap_codex_smoke(access_token) helper (~110 行): - POST /backend-api/codex/responses + stream + reasoning.effort=none + 最小 payload - 5s timeout (实施改为 15s,SPEC 同步对齐) - 读第一帧 SSE event: response.created 立即 close - 返回 ("ok"/"auth_invalid"/"network_error", reason) - 4xx body 关键词扫描: quota/no_quota/rate_limit/billing/exceeded 3. check_codex_quota 内部消化 smoke:I5 命中时自动 cheap_codex_smoke 二次验证, smoke ok→返 ok+smoke_verified=True,smoke fail→返 auth_error, 9+2 调用方完全无感知(架构更优) ## P1 修复 (4 处补丁) P1.1 — login_codex_via…b5a697b -
feat(round-4 lifecycle): SPEC-2 账号生命周期/配额/席位/被踢识别全套落地
Wave 4 of 4 — 完成 issue #2 + #4 + #6 共因合并修复 (5 共因 A-E + 3 独属 F-H)。 ## 共因点修复 (Issue #2 + #4 + #6 三联) A. plan_type 白名单 (accounts.py) - SUPPORTED_PLAN_TYPES = {team, free, plus, pro} - normalize_plan_type / is_supported_plan - bundle 落盘前先验,plan_supported=False 直拒入池 B. wham/usage no_quota 分类 (codex_auth.py) - 5 分类: ok / exhausted / no_quota / auth_error / network_error - no_quota 优先级高于 exhausted - primary_total==0 / rate_limit 缺失 / remaining==0+total==0 三路触发 C. add-phone 探针接通 (codex_auth.py) - login_codex_via_browser 加 3 处 assert_not_blocked: about-you / consent loop / callback wait - invite.py 探针 4 处 (email/password/code/profile) 已存在 D. _run_post_register_oauth quota probe (manager.py) - team + personal 双分支对称设计 - bundle 拿到后立即 probe,no_quota 标 AUTH_INVALID - 5 分类对应 STATUS_ACTIVE/EXHAUSTED/AUTH_INVALID 转换 E. sync_account_states 区分被踢 vs 待机 (manager.py) - _probe_kicked_account: wham/usage 401/403 → AUTH_INVALID, 其他 → STANDBY - ThreadPoolExecutor 并发上限…478c16c -
feat(round-4 mail): SPEC-1 Mail Provider 全量化 + 邮箱归属验证 UI + 文档同步
Wave 3 — SPEC-1 实施(@prd-mail): 后端: - mail/probe.py(新):probe_fingerprint / probe_credentials / probe_domain_ownership 三段式 helper,共享给 /api/config/register-domain - mail/cf_temp_email.py: login() / create_temp_email() 嗅探收紧到正向白名单,响应缺关键字段立即抛错(防 200 假成功) - mail/maillab.py: _with_login_retry 装饰器 + threading.local 双 guard(in_login + retried),防 401 自愈递归 - setup_wizard.py: _sniff_provider_mismatch 改强阻断(协议错配立即 return False),AUTOTEAM_SKIP_PROVIDER_SNIFF=1 逃生口 - api.py: SetupConfig 扩 5 字段(MAIL_PROVIDER+MAILLAB_*4)+ post_setup_save 互斥写盘 + ProbeErrorCode 9 枚举 + MailProviderProbeRequest/Response + POST /api/mail-provider/probe(setup 阶段免鉴权 + 60req/min IP 限速 + 已配置后手工二次 Bearer 校验) 前端: - web/src/api.js: probeMailProvider 客户端方法 - SetupPage.vue: 4 步状态机 PROVIDER → CONNECTION → DOMAIN → SAVE,切换 provider 重置下游,前端零 token 缓存 - Settings.vue: 新增「邮箱后端」区块复用 SetupPage 状态机,保存后 toast 提示重启服务 测试(28 新): - tests/unit/test_mail_cf_temp_email_sniff.py(11): login + create_temp_email 嗅探规则 parametrized - tests/unit/test_mail_…f82773a -
feat(round-4 infra): docker-guard + playwright-hardening + 调研/PRD/SPEC 文档基线
实施依据(prompts/0426/): - 6 份 research 报告(2170 行)— issue#1 cloudmail / #2 seat / #3 import / #4 oauth+phone / #5 playwright / #6 invite/kick - 4 份 PRD(1856 行)+ synthesis 综合分析 - 8 份 SPEC(4742 行,含 4 份 shared 共享契约) Wave 1 — SPEC-3 Docker 守卫(@prd-docker): - Dockerfile: ARG GIT_SHA + LABEL + ENV(WORKDIR 后定位,不击穿 uv sync 缓存) - docker-compose.yml: build.args ${GIT_SHA:-unknown} 降级 - docker-entrypoint.sh: uv run python heredoc 启动期 import 自检 11 符号 + crash-loop - pyproject.toml: [tool.ruff.lint] F401/F811/F821 + per-file-ignores - .pre-commit-config.yaml: 收紧 ruff args 到 SPEC 三规则 - src/autoteam/api.py: VersionResponse + GET /api/version + _AUTH_SKIP_PATHS 加白 - docs/{api,docker}.md: SOP 4 步 rebuild + 验证 + 故障排查 - tests/integration/test_docker_guard.py: 10 个测试覆盖 AC1/3/4/5/7/9 + 4 静态契约 Wave 2 — SPEC-4 Playwright 一致性硬化(@prd-playwright): - src/autoteam/_playwright_guard.py(新):9 符号 import 白名单 + assert_sync_context() - src/autoteam/api.py: _PlaywrightExecutor 双入口 guard(run_with_timeout + _worker) - src/aut…d9d9e44
-
fix(round-3): exhausted 自愈 + workspace 指纹 + CPA 删除守卫 + 双 typo
涵盖用户手测后报的 4 个 bug: 1. fix(api): list_accounts → load_accounts(api.py:1942) "生成免费号"按钮的 leave_workspace=True 分支误写函数名, ImportError → 500 → 前端报"非 JSON 响应"。单点改名。 2. feat(check): exhausted 自愈 cmd_check 新增"复测 quota_resets_at <= now 的 exhausted 账号"分支, wham/usage 返回 ok 且剩余 ≥ 阈值 → 直接 promote 回 active, 省一次 kick → standby → re-invite 的全流程。 exhausted/auth_error/network_error 各走自己分支,不动状态。 3. feat(accounts): workspace_account_id 字段(母号切换防错杀) accounts.json 每条记录新增 workspace_account_id,记录该号被邀请 时所属的 ChatGPT Team workspace account_id。 - add_account() 接受新参数(可选,legacy 记录 None 兼容) - invite.py / manager._run_post_register_oauth / manual_account.py / cmd_check pending→active / _reconcile_team_members pending→active+standby→active / cmd_replace_one 旧号恢复 / api post-login 全部改为 stamp 当前 get_chatgpt_account_id() - sync_account_states 的 active→standby flip 加守卫: workspace_account_id 与当前 account_id 都存在且不同 → 跳过 flip + WARN log,不再把"前母号留下号"误标 standby 4. fi…cf2f7d3 -
fix(invite-hardening): round-2 实际修复落地 — invite/reconcile/standby/UI
# 团队协作产出(5 fix task,4 个并行 fixer agent + 1 docs) ## fix(standby): check_codex_quota 加 network_error 分类(最优先,事故根因) - check_codex_quota 4 类返回(ok/exhausted/auth_error/network_error); auth_error 仅 401/403,5xx/429/Connection/Timeout/SSL/JSON 解析失败 → network_error - _probe_standby_quota 的 network_error 分支:不写 last_quota_check_at + 不改 status - 同步审计 cmd_check active 主循环 / personal 分支 / 假恢复验证 / 替换池复用 / 自动复用 5 处 status_str 分支适配新枚举 - 新增 3 个回归测试,覆盖 11 case(含 5xx/429/Connection/Timeout/SSL/JSON/ok) - 真机回滚:18 个被误标 AUTH_INVALID 的号已批量删除(本地+邮箱+CPA) ## fix(invite): 5xx 重试 / domain 关键词收窄 / invite_to_team 死代码下沉 - _classify_invite_error 新增 server_error 分类(500/502/503/504),与 network/ rate_limited 一并触发退避 retry - _DOMAIN_BLOCKED_KEYWORDS 收窄到 5 个明确短语,移除裸 domain/forbidden/blocked - errored_emails[].error/code/message 内层字段进入扫描;停止 fallthrough resp_body - POST 重试加 30% jitter,批量号不再同步反弹 - 把 invite_to_team 的 default→usage_based fallback + errored_emails + _seat_type 全下沉到 invite_member 内部(_invite_member_with_fal…9e11583 -
feat(invite-hardening): seat fallback / standby probe / reconcile 三路加固
# 需求 2 + Team 状态对账加固(团队协作产出,5 task 5 agent) ## invite seat fallback 鲁棒性 - chatgpt_api.invite_member POST/PATCH 都加分类 + 退避重试([5s,15s]) - PATCH 失败时保留 codex 席位(_seat_type="usage_based"),不再静默丢账号 - 响应 dict 必带 _seat_type ∈ {chatgpt, usage_based, unknown} + _error_kind - accounts.json 持久化 seat_type(SEAT_CHATGPT/SEAT_CODEX/SEAT_UNKNOWN 常量) ## cmd_check --include-standby - _probe_standby_quota:遍历 standby 池,限速 1.5s,24h 去重 - 401/403 → STATUS_AUTH_INVALID - accounts.json 加 last_quota_check_at 字段 - API /api/tasks/check 接受 include_standby ## reconcile 4 类异常分支 - 残废(active+无 auth)→ 先从 auths/ 兜底,失败按 RECONCILE_KICK_ORPHAN 决定 - 错位(本地 standby+workspace active)→ 改 active+补 auth_file - 耗尽未抛弃(active+last_quota >= 100%)→ 标 STATUS_EXHAUSTED,不立即 kick(避免 token_revoked) - ghost(workspace 有+本地无)→ 按 RECONCILE_KICK_GHOST 决定 - 新命令:autoteam reconcile [--dry-run] - 新端点:POST /api/admin/reconcile?dry_run=1 ## 测试 - 3 个新测试文件,15 个用例全过 - pytest tests/unit/ 58 passed(2 个 pre-existing 失败与本批无关) - ruff format/check 干净 ## 附带 …d6082ad
-
fix(team-revoke): 区分 token 风控 vs quota 用完 + watchdog 冷却
Why: 现场实测发现 18 个 standby 号 wham/usage 全部返回 401 token_revoked / token_invalidated —— OpenAI 对短期内反复 invite/kick 的子号做批量风控, 不是 quota 问题。 但旧版 reinvite_account 假恢复路径不区分原因,把 token 风控也按"quota 用完" 锁 5h(quota_resets_at = now + 18000)。后果:账号永久死锁在 standby (锁多久都等不来 token revoke 解除,只能重新走 OAuth 拿新 token)。 而上一版的 watchdog(active<cap 立刻触发 cmd_rotate)反而是放大器: 每 5min 巡检无脑触发 → cmd_rotate 内部反复 invite/kick → OpenAI 风控 立刻批量 revoke 这一批号的 token → 全部死锁。 How: - manager.py reinvite_account: fail_reason 分 quota_low/exhausted/auth_error/ exception。前两者保持锁 5h(等自然恢复);后两者(token 风控)清掉 quota_exhausted_at/quota_resets_at,降级 standby 让下次有机会重新 OAuth。 - api.py auto_check_loop: watchdog 加 30 分钟冷却,避免反复触发 cmd_rotate 叠加风控。冷却期内仍跑"低额度替换"(逐个 1v1)但不触发全量 cmd_rotate。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>5a35372 -
fix(team-shrink): 巡检加 watchdog + 假恢复必刷 last_quota
Why: 用户现场仍出 team 子号问题:Team 长期只 2 active(应 4),standby 死锁。 根因三处: A) auto_check_loop active=0 时直接 continue,Team 萎缩没人补 —— 4 个 active 都 quota 低被 kick 进 standby 后,下一轮巡检看不到 active 就什么都不做,Team 永远不会自动补回 cap。 B) reinvite_account 假恢复路径不写 last_quota,UI/下游看到的还是上次 成功的旧值(比如 0%),误判可用。01544b9745 锁死就是这个。 C) _replace_single 候选号实测 ok/exhausted 时也没回写 last_quota,同病。 How: - api.py auto_check_loop:active < TEAM_SUB_ACCOUNT_HARD_CAP 立刻 _start_task("auto-fill", cmd_rotate, target=cap+1),全流程补位。 - manager.py reinvite_account:status=ok 路径无论真假恢复都 update_account last_quota=info;exhausted 路径拆 quota_result_quota_info 写。 - manager.py _replace_single:候选号实测后同步写 last_quota。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>3c26e88 -
feat(fill-personal): 队列化拒绝,Team 满席时不再借位
Why: 满席规则(4 子号)与 fill-personal 借位需求冲突。原实现 baseline 已 4 时仍 强放 1 个,导致 Team 瞬时超员触发 OpenAI 风控。用户决定走 Solution C — 最小化风控暴露,直接拒绝。 How: - _cmd_fill_personal 入口若 baseline >= TEAM_SUB_ACCOUNT_HARD_CAP 立刻 return,并把 count 上限压到 (cap - baseline) - max_new_this_batch 去掉 max(1, ...) 兜底,严格按可用席位执行 - POST /api/tasks/fill?leave_workspace=true 加 409 前置校验,本地 active+exhausted 即满则不启动后台任务 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>3f13ba6 -
fix(reuse): 三层防止 standby 被误判恢复反复洗同一批耗尽账号
现场事故:auto-check 把已耗尽的老号反复 kick → reinvite → OAuth 成功 plan=team → 再次 kick,4 个子号配额永远没涨过,最终 Team 从 4 掉到 1。根因三个,全部修复: 1. `_auto_check_loop` 标 exhausted 时只写 quota_exhausted_at,漏 quota_resets_at。 `get_standby_accounts()` 看到 resets_at=None 就默认 `_quota_recovered=True`, 把这批 0% 账号永远标"随时可复用"。补上 `quota_resets_at = now + 5h`。 2. `_replace_single` 选 standby 候选时只信 `_quota_recovered` 标志位,没做实测。 照搬 cmd_rotate 的做法,拿 auth_file 里的 access_token 打一次 check_codex_quota, 必须 status=ok 且剩余 >= threshold 才允许复用;exhausted/auth_error/无 auth_file 一律跳过,宁可创建新号也不把 0% 号塞回 Team。 3. reinvite_account OAuth 成功 plan=team 也不等于"账号真活了"。存在竞态:刚 kick 的 账号在 OpenAI 端处于 soft-removed/缓存未刷新状态,OAuth 仍能拿到 team workspace token,但配额本身没重置。成功后必须拿新 token 实测一次 wham,达不到 threshold 就 判定"假恢复",立刻 kick 掉 + 写 quota_resets_at=now+5h,让 Team 席位交给新号。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>aeafda6 -
chore(auto-check): 清理 min_low 在日志里的残留文案
min_low 在 f6e9a4a 已不参与判断(改为任意失效立即 1v1 替换),但 _auto_check_loop 启动日志和 set_auto_check_config 的更新日志仍打印 "触发: >=N 个" 会让用户误以为 旧语义还在。改成明确说明新行为,min_low 字段本身保留作 API schema 兼容。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>398846f -
feat(auto-replace): Team 子号失效立即 1 对 1 替换
新增定点替换能力,auto-check 发现任意失效(不再等凑 min_low)立即逐个替换, 席位始终维持在 4/4 硬上限内,不会因为 batch rotate 短暂掉到 2 或 3。 - manager.cmd_replace_one(email, reason): 外部入口,自建 chatgpt+mail - manager.cmd_replace_batch(emails, trigger): auto-check 用,复用同一浏览器 - manager._replace_single(chatgpt, mail, email, reason): 内部实现 kick → 若 Team 子号 < 4 则补一个(优先 standby 复用,否则 create_new_account) 已达硬上限则只 kick 不补;kick 后确认 email != 候选 email 防自环 api._auto_check_loop: 任意 low 账号都触发 cmd_replace_batch,不再按 min_low 聚合等待。 min_low 字段保留作兼容但不参与判断。playwright_lock 冲突时本轮跳过。 新增 POST /api/tasks/replace {email, reason},前端/手动也能触发。 端到端验证(task fa73db9c):7a404a4a5f(5h=1%) → kick → standby 候选 01544b9745 reinvite OAuth plan=free → reinvite cleanup 自动 kick → 无其他 standby 可复用 → 创建新号 bb2aafb345(plan=team)→ 补位成功。Team 子号始终在 3-4 席,从未掉到更低。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>f6e9a4a -
style: apply ruff format
Pre-commit CI ran ruff format --check on the initial AutoTeam-F commit and flagged 9 files. No logic changes — only whitespace normalization (line continuations, merged strings). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1f6d7ba -
feat: AutoTeam-F — fork of cnitlrt/AutoTeam with fixes and free-account pipeline
New features: - Personal account batch production (fill-personal) with baseline protection — preserves existing Team seats, caps total Team members at 4 - Soft task cancellation via cancel_signal module (cooperative, safe boundaries) - Register failure classification + persistence (register_failures.json) - Admin diagnose + fix-account-id endpoints for session/workspace debugging - Batch account deletion in Web UI (shared chatgpt_api + mail_client) - Runtime domain config switching (runtime_config.py) Fixes: - Correct account_id resolution on session_token import /backend-api/accounts is now the authoritative source; /settings double-checks - Skip step-0 ChatGPT pre-login in personal OAuth mode (fixes "Operation timed out") - Password generator produces 15-17 chars (OpenAI requires 12+) - cancel_signal reset ordering in _run_task prevents swallowed cancellations - Batch operations use dynamic timeout via run_with_timeout(timeout, func) - fill-personal fail-fast on 3 consecutive 40…3df0958
-
fix: restore required setup fields
- require CPA_URL and API_KEY again in setup checks while keeping proxy fields optional\n- default CPA_URL and auto-generate API_KEY when saving setup config\n- remove the host.docker.internal host-gateway mapping from default compose/docsbf58c8d
-
feat: support Playwright proxy configuration
Zhi Yangfcb2d84
-
fix: stabilize main account status and reuse flow
- normalize main account dashboard status from saved auth/quota and hide pool-only actions\n- exclude main account from auto-check exhaustion while keeping main auth export available\n- stop standby reinvite on Google redirects and respect weekly reset before reuse97b647d
-
style: format api thread wrappers
b54f73e -
Merge remote-tracking branch 'origin/dev' into pr6-work
8fb4959 -
fix: protect main account and exhausted quota state
7a30713 -
fix: keep export for main account
ac569aa
-
fix: harden auth sync and direct signup flow
ea9862c
-
feat: add admin session token import
b6bcc3c -
fix: route sync API Playwright calls to dedicated thread
Zhi Yang84963b2 -
feat: 账号列表新增「导出」按钮,生成 Codex CLI 格式 auth.json
- 新增 GET /api/accounts/{email}/codex-auth 端点 - 前端弹窗展示 JSON 内容 + 复制按钮 + 下载按钮 - 提示保存路径:~/.codex/auth.json 或 %APPDATA%\codex\auth.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>ad9c2d9 -
fix: 修复 CPA 反向同步与成员页操作
Co-authored-by: Claude <noreply@anthropic.com>876283e -
feat: 支持从 CPA 反向同步认证文件到本地
Co-authored-by: Claude <noreply@anthropic.com>2ddc3ee -
feat: 支持 OAuth 自动回调与手动回调导入账号
a08d7b4 -
fix: 兼容 Windows 下的 UTF-8 配置读写
Co-authored-by: Claude <noreply@anthropic.com>d0b6cac