[Bug][Antigravity] OAuth 授权缺少 aicode 权限导致语音转录失败 / Voice transcription fails due to missing aicode OAuth scope (#2361)
问题描述 / Problem Description
在 Cockpit Tools 中通过 OAuth 登录 Antigravity 账号后,正常的文本对话与代码补全功能均可正常使用,但 Antigravity 2.0+ 内置的**实时语音转录(麦克风输入 / Ctrl+Shift+M)**会在开启约 1 秒后立即中断,无法录入语音。
When authenticating Google Antigravity accounts through Cockpit Tools, standard text prompts and code assistance work as expected, but the built-in Live Voice Transcription (streamAudioTranscription via the microphone button or Ctrl+Shift+M) fails immediately within ~1 second.
错误日志 / Error Logs
检查 Antigravity 运行时控制台(Electron Console)可以看到底层 gRPC 报错:
[AudioStreaming] Stream error: ConnectError: [internal] internal: failed to receive setup response from backend: rpc error: code = PermissionDenied desc = Request had insufficient authentication scopes.
[AudioStreaming] Failed to start: ConnectError: [internal] internal: failed to receive setup response from backend: rpc error: code = PermissionDenied desc = Request had insufficient authentication scopes.根本原因 / Root Cause
在 src-tauri/src/modules/oauth.rs 和 crates/cockpit-core/src/modules/oauth.rs 中,get_auth_url 生成的 OAuth scopes 列表中缺少了 Antigravity 2.0+ 实时音频流所需的 Google Cloud Code AI 权限:
https://www.googleapis.com/auth/aicode
导致获取到的 access_token 和 refresh_token 在调用 Google 语音转录后端时被权限拦截拒绝。
In src-tauri/src/modules/oauth.rs and crates/cockpit-core/src/modules/oauth.rs, the OAuth scopes list in get_auth_url lacks the Google Cloud Code AI scope required for bidirectional audio streaming: https://www.googleapis.com/auth/aicode.
解决方案 / Solution & PR
已经为此提交了 Pull Request,代码修改非常精简(仅在两个模块的 scopes 列表中追加 "https://www.googleapis.com/auth/aicode"):
PR 已就绪: #2361
麻烦维护者抽空 review 并合并,非常感谢! Please review and merge #2361. Thank you!
Source: jlcodes99/cockpit-tools