修复 Antigravity OAuth 导入后配额复检缺 project#624
Open
MMEXA wants to merge 1 commit into
Open
Conversation
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.
前因后果
本机 Antigravity CLI 能正常对话,但 Aether 导入同一个 Antigravity OAuth 凭据后,出现“Token 刷新成功,但额度/账号状态复检失败:缺少 OAuth 认证信息,请先授权/刷新 Token”。现场排查发现 token 刷新本身成功,失败点在 Aether 构造 Antigravity
fetchAvailableModels请求前:缺少 CLI 运行时使用的 workspace backendproject_id,导致身份头解析失败。本机 Antigravity 日志显示当前链路会先访问
daily-cloudcode-pa.googleapis.com/v1internal:loadCodeAssist获取cloudaicompanionProject.id,再访问daily-cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels,并使用 Antigravity UA/客户端头。Aether 原实现只从auth_config.project_id等少数字段读 project,导入时也没有给 Antigravity 应用 project hints,因此 OAuth token 有效但配额复检仍会报缺认证信息。修复内容
project_id、projectId、cloudaicompanionProject、cloudAiCompanionProject、clientVersion、sessionId、userAgent等身份 hints。auth_config和upstream_metadata.antigravity读取 project/client/session,并支持cloudaicompanionProject.id结构。loadCodeAssist计划。loadCodeAssist水合 project,再用 daily host 调fetchAvailableModels。验证
cargo fmt --checkcargo test -p aether-provider-transport antigravity --libcargo test -p aether-model-fetch antigravity --libcargo test -p aether-gateway antigravity --libcargo test -p aether-gateway single_import_applies_antigravity_identity_hints --libcargo test -p aether-gateway applies_antigravity_project_and_user_agent_hints_to_auth_config --libgit diff --check