feat(provider): 支持 Grok OAuth 订阅账号#684
Draft
qiaoen12 wants to merge 3 commits into
Draft
Conversation
Add the xAI OAuth lifecycle, Responses runtime routing, provider-pool scheduling, Billing quota refresh, and minimal admin UI integration for Grok subscription accounts.
qiaoen12
force-pushed
the
codex/grok-oauth-provider-20260719
branch
from
July 20, 2026 08:19
9189545 to
9087b71
Compare
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.
背景
Aether 已支持 Grok API Key,但尚缺少 Grok CLI 订阅账号的 OAuth 接入、账号池调度和订阅额度展示。本 PR 参考 Sub2API 的订阅账号能力,按 Aether 现有 OAuth、transport 与 provider-pool 架构补齐最小可运行链路。
实现范围
grok_oauthprovider 类型,接入 xAI OAuth2 PKCE、authorization code、refresh token 单个及批量导入。aether-oauth的共享 helper:id_token优先,token response 与access_token作为回退,并保留account_name、plan_type等非身份字段。x-grok-client-version与User-Agent,避免客户端版本不一致。模块边界与非目标
grok_oauth精确隔离。grokAPI Key/浏览器会话 provider 及其他 provider 的原有行为。与上游的集成
9087b7133ae17d40464945bb918f68dc2ff2b790。main@7756c0913f2e0089575d019f1ca90d9867f35c52。range-diff确认功能补丁保持等价。本地验证
cargo fmt --all -- --checkgit diff --check upstream/main...HEADcargo test -p aether-gateway grok_oauth:22 项通过cargo check -p aether-gatewaynpm --prefix frontend run type-checknpm --prefix frontend run build最后一次同步上游后,再次通过
cargo check -p aether-gateway与 22 项 Gateway Grok OAuth 回归。运行验证说明
9189545bf7d0de5cb302803bffaf2d9e21ec9b2a已在隔离的 vps1 环境完成镜像构建、容器健康、readiness、Billing、quota refresh 与 Responses canary。9087b7133ae17d40464945bb918f68dc2ff2b790尚未重新部署到 vps1;本 PR 不把旧候选的运行结果冒充为当前提交的线上验证。风险与回退
grok_oauth隔离。provider_type使用既有非约束文本字段。grok_oauthprovider;现有grok与其他 provider 无需迁移。