feat(auth): reuse Grok subscriptions in Claude Code and Codex - #185
Open
NongHua123 wants to merge 4 commits into
Open
feat(auth): reuse Grok subscriptions in Claude Code and Codex#185NongHua123 wants to merge 4 commits into
NongHua123 wants to merge 4 commits into
Conversation
Preserve the original feature tree and author while normalizing its subject for current commit checks. Original-Commit: b8b15db
Integrate the original Grok branch with FyAgent 0.4.4 and connect saved managed accounts to Claude Code and Codex through the existing local proxy and Change Plan. Preserve the original remote branch and current user checkout. Source commit metadata is normalized only in this continuation branch; the original source tree, parent and author are retained. Original-Commit: b8b15db Normalized-Source: 55cea0b
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.
范围与原因
让 FyAgent 已保存的 Grok 订阅账号用于 Claude Code 和 Codex CLI。Claude 在模型页确认后应用;Codex 先保存订阅来源,再沿现有 Change Plan 预览、确认和回读。复用现有 Managed Auth、密钥库和本机转发,无需 Docker、云账号或额外服务。
修复旧分支依赖旧 JSON 登录态、固定 Provider 身份和普通 API 入口的问题。订阅请求使用官方 Grok CLI 文档提供的专用入口,后端设置认证及最终模型路由头;覆盖 Claude Messages / Codex Responses 的转换和流式工具调用。令牌不进入 renderer 或目标配置,Codex 原生登录文件保留独立,失败恢复经过回读,多目标并发激活受统一锁保护,不静默转用其他账号或 API 计费。
界面标记实验性,模型选项只代表官方示例。当前暴露 Claude Code/Codex CLI;Claude Desktop 草稿 API 保留,WorkBuddy 保留普通 API 配置。
关联工作与技术方案
feat/grok-first-class-iteration保持不变;关联 [G2-09] 把同一接入源安全地投放给多个 Agent #42 / [G2-10] 为官方订阅连接建立逐厂商准入门槛 #43,均不关闭。验证证据
macOS Apple Silicon,锁定依赖与工具链;各门禁串行运行。
mise run check:backend:3518 passed / 6 ignored;Rust fmt/check/Clippy 通过。mise run check:contracts均通过;最终 4 个提交的规范检查和相对主线 whitespace 检查通过。mise run test:browser:生产启动 2 项及 renderer 主矩阵 534 项通过;新增订阅 WebKit 专项 2/2 通过,并纳入后续标准矩阵。主矩阵使用开发服务器,生产性能单独验证。mise run test:performance:首轮 34 passed / 1 failed,账号弹窗 1x 帧 P95 为 33.7 ms(阈值 33.4 ms);不改阈值单独复跑该 spec,1x/4x 共 2/2 通过,1x P95 为 33.4 ms。保留这次边缘波动记录,没有把首轮非零退出写成全绿。风险与回退
该入口属于实验性兼容接入,官方 CLI 上游合同变化可能需要适配。使用期间需要 FyAgent 在后台运行;配置恢复、真正退出恢复和下次启动接管沿用现有生命周期。恢复采用既有目标文件备份和来源切换路径。本 PR 不升级依赖、不发布或覆盖正式安装。
契约与来源
2f264d2f89326601a33f610c72a9f0143306d066。原来源提交b8b15dba的标题不符合当前 CI,仅在新分支使用同树、同父、同作者的规范标题副本55cea0b5,保留 Original-Commit 来源;原分支/PR 不改写。72a61251fcffb464bcc687aeb5a998e5a98ec0c9的接口说明,不引入第三方服务代码或新的网关依赖。.venv或用户数据。