新增成员账号体系并收敛单人管理员模式导航#225
Merged
Merged
Conversation
# Conflicts: # apps/src/app/page.tsx # apps/src/components/modals/api-key-modal.tsx # apps/tests/transport-web-commands.test.mjs # crates/service/src/rpc_dispatch/apikey.rs
Contributor
Author
|
关联 issue:#201。 这条 PR 可以视为 #201 的阶段性实现,不建议自动关闭 issue,因为 #201 里还有卡密充值、项目维度、套餐/月度额度、风控提醒等更平台化的后续能力。 当前 PR 对 #201 的实现进度大致如下:
仍未覆盖或需要后续继续拆分的范围:
因此这条 PR 更适合作为 #201 的 Phase 1 + 部分 Phase 2 落地版本,后续可以继续围绕卡密、项目维度和更严格结算策略拆分 PR。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
这个 PR 将
feature-account-manager分支提交到upstream/main。本次变更范围较大,核心目标是补齐 CodexManager 的成员账号体系、额度与模型组管理、成员视角能力,并根据 OpenSpec 变更hide-account-system-navigation-in-single-admin-mode收敛单人管理员模式导航:none/password模式作为单人管理员模式,不再暴露成员账号体系入口;accounts模式保持成员账号体系和成员行为。由于本次变动涉及前端导航、Web 登录模式、成员账号、API Key 归属、模型组、额度分发、仪表盘、请求日志和数据库迁移,建议维护者先发布测试版或预发布版本,让真实部署用户验证升级、登录模式切换、账号池与平台 Key 工作流,再进入稳定版发布。
主要变更
/account-manager,支持成员账号管理、余额查看与充值等账号体系操作。/model-groups,支持将平台模型与成员可见模型组关联。role + mode判断可见路由:none/password单人管理员模式隐藏/account-manager和/model-groups。none/password仍保留 OpenAI 上游账号池/accounts、聚合 API、平台模型、平台密钥、日志、设置、插件和赞助入口。accounts管理员继续显示成员账号与模型组入口。accounts成员保持成员自助导航。/apikeys平台密钥页:accounts模式下保留成员归属列、归属选择器和 owner 保存逻辑。hide-account-system-navigation-in-single-admin-mode。数据与后端
none、password、accounts,并由 session 驱动前端导航与成员行为。验证
已在本地执行:
pnpm run test:runtimenode --test tests/top-level-routes.test.mjspnpm run build:desktoppnpm exec playwright test tests/accounts-status-reason.spec.ts同时用真实/临时运行实例验证过单人管理员模式导航收敛:
none模式:隐藏成员账号与模型组入口,保留 OpenAI 账号池和平台密钥。password模式:登录后同样隐藏成员账号体系入口,退出/重新登录流程正常。accounts管理员:成员账号与模型组入口可见且可进入。accounts成员:保持成员导航,不显示管理员账号体系入口。/apikeys单人模式:平台 Key 可列表/创建/编辑,不显示成员归属列和归属选择器,保存不要求 owner。/apikeysaccounts 模式:成员归属列和归属选择器按账号体系规则显示。发布建议
本 PR 是一组较大的产品能力和数据模型变更。建议 upstream 维护者先发布测试版本,重点验证:
none、password、accounts三种 Web auth mode 的升级兼容性。codexmanager-web/codexmanager-service部署方式的一致性。