Skip to content

feat(gemini): 在 VM 页面统一管理宿主账号与专用 API Key - #1173

Merged
dofastted merged 2 commits into
mainfrom
feat/gemini-host-accounts
Nov 17, 2026
Merged

dofastted merged 2 commits into
mainfrom
feat/gemini-host-accounts

Conversation

@dofastted

@dofastted dofastted commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

改动

  • 将 Gemini 宿主账号并入现有 VM 列表和机架,沿用 OpenAI 账号的布局、筛选和操作入口;导入仍只创建宿主环境,不创建 VM。
  • 允许创建 Gemini 平台专用 API Key,隔离 Gemini 与 OpenAI/Claude 路由和模型权限。
  • 分开显示 Google OAuth 授权状态与运行状态;本 PR 不引入反代源码或替换 CRAGAnti 载荷。

边界

  • 当前 CRAGAnti 载荷只验证过使用上游 API Key 的推理;Google OAuth 凭证推理、Codex 调度复用及官方逐回合计费尚未接通或核实。
  • Gemini 专用入口目前返回 503 gemini_runtime_not_supported,不派单、不扣费;不会将已授权标为运行就绪。

验证

  • 后端核心 265 项;前端核心及定向 97 项;API Key 网关端到端 2 项。
  • 前端构建,以及使用模拟数据的桌面/移动端浏览器验证通过。未验证生产 OAuth 推理。

Note

Medium Risk
Changes managed-key authorization and public route handling for a new platform scope; inference remains disabled but misconfiguration could confuse operators or block legitimate non-Gemini keys if scope checks regress.

Overview
Introduces an admin-only gemini API key scope so dedicated keys can hit Gemini session/self-service paths only; gateway auth rejects those keys on Claude, Codex, and other inference routes, and /v1/gemini/sessions still fails closed with gemini_runtime_not_supported (replacing the prior blanket billing-unavailable behavior).

Panel/backend: key normalization forbids VM lists, pools, or API category on Gemini keys; non-admins cannot create or retarget Gemini keys. Gemini keys get an empty /v1/models list.

Panel UI: host Gemini environments are mapped into the existing VM rack/table (platform filter, CRAGAnti labeling, proxy display, detail dialog for authorize/refresh) while Import → Gemini stays create-only; key dialogs add Gemini · CRAGAnti with matching client payload validation.

Docs and e2e/unit tests cover the new scope, routing, and UI boundaries (no OAuth inference or billing yet).

Reviewed by Cursor Bugbot for commit e7545f1. Configure here.

@cursor

cursor Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 73dd7e2f-0773-4624-8f05-b169c68c6753)

@dofastted
dofastted merged commit a7751e5 into main Nov 17, 2026
4 of 6 checks passed
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.

1 participant