Skip to content

新增 Claude 官方账号切换#3192

Open
Birditch wants to merge 2 commits into
farion1231:mainfrom
Birditch:feature/claude-code-official-accounts
Open

新增 Claude 官方账号切换#3192
Birditch wants to merge 2 commits into
farion1231:mainfrom
Birditch:feature/claude-code-official-accounts

Conversation

@Birditch
Copy link
Copy Markdown

@Birditch Birditch commented May 26, 2026

概要

  • 新增 Claude Official 账号快照能力,基于 Claude Code OAuth 凭据保存账号,并通过官方 profile 接口获取邮箱。
  • 新增邮箱设置页管理界面,支持保存并激活、查询 5h/7d 用量、删除账号快照。
  • 切换 Claude live 配置时使用选中的官方账号;当 5h/7d 用量达到 95% 阈值时,自动切换到可用账号。

测试

  • pnpm typecheck
  • cargo test --manifest-path src-tauri/Cargo.toml claude_official_accounts
  • pnpm tauri build --target aarch64-apple-darwin --bundles app --config '{"bundle":{"createUpdaterArtifacts":false}}'

Co-authored-by: Cursor <cursoragent@cursor.com>
@Birditch Birditch changed the title Add Claude official account switching 新增 Claude 官方账号切换 May 26, 2026
@Birditch
Copy link
Copy Markdown
Author

关于大家比较关心的“多官方账号切换是否容易触发封禁/异常”问题,我补充一下自己的实际使用情况。

我这边目前有 3 个 Claude Code 官方账号,均为正常付费订阅账号,没有共享、滥用或绕过订阅逻辑:

  • 账号来源均为正常注册;
  • 使用苹果隐私邮箱 / Google 账号等常规方式登录;
  • 订阅均通过 Google Play / App Store 等官方渠道续费购买;
  • 已连续使用 2 个多月,目前 3 个账号均未出现封禁、风控或异常提示。

所以从我的实际经验来看,官方账号之间的本地切换本身并不等同于高风险行为。
这个 PR 的目标也不是规避官方规则,而是解决多个合法付费账号在本地使用时频繁重新认证、手动切换成本过高的问题。

当然,这不代表我能替任何人保证“绝对不会触发风控”。但至少在合法订阅、正常使用、不共享账号、不绕过官方认证的前提下,多账号切换在实践中是可行的,也有真实使用经验支撑。

@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 844791e33c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/claude_official_accounts.rs Outdated
Comment thread src-tauri/src/services/provider/live.rs Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
@Birditch
Copy link
Copy Markdown
Author

@chatgpt-codex-connector 已根据 review 修复并推送:

  • P1:当绑定的 Claude Official 快照缺失/损坏或刷新失败时,不再直接阻塞切换,会将该账号视为不可用并继续寻找其他可用账号。
  • P2:Claude live 配置写入顺序已调整为先激活/校验 Claude Official 账号,成功后再写入 settings.json,避免账号激活失败时留下半应用的 live 配置。

验证:

  • pnpm typecheck
  • cargo test --manifest-path src-tauri/Cargo.toml claude_official_accounts

已标记 review threads 为 resolved。

@Birditch
Copy link
Copy Markdown
Author

@farion1231 已根据 Codex review 修复两处问题并推送:

  • 绑定的 Claude Official 快照缺失/损坏时,会回退尝试其他可用账号。
  • Claude live 配置改为账号激活/校验成功后再写入,避免半切换状态。

相关 review threads 已标记 resolved,麻烦有空再帮忙看一下。

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.

2 participants