|
14 | 14 |
|
15 | 15 | lib_logger = logging.getLogger("rotator_library") |
16 | 16 |
|
17 | | -# Headers for Gemini CLI auth/discovery calls |
18 | | -# Uses KV string format for Client-Metadata (different from Antigravity's JSON format) |
| 17 | +# Headers for Gemini CLI auth/discovery calls (loadCodeAssist, onboardUser, etc.) |
| 18 | +# |
| 19 | +# For OAuth/Code Assist path, native gemini-cli only sends: |
| 20 | +# - Content-Type: application/json |
| 21 | +# - Authorization: Bearer <token> |
| 22 | +# - User-Agent: GeminiCLI/${version} (${platform}; ${arch}) |
| 23 | +# |
| 24 | +# Headers NOT sent by native CLI (confirmed via explore agent analysis of server.ts): |
| 25 | +# - X-Goog-Api-Client: Not used in Code Assist path |
| 26 | +# - Client-Metadata: Sent in REQUEST BODY for these endpoints, not as HTTP header |
| 27 | +# |
| 28 | +# Note: The commented headers below previously worked well for SDK fingerprinting. |
| 29 | +# Uncomment if you want to try SDK mimicry for potential rate limit benefits. |
| 30 | +# |
| 31 | +# Source: gemini-cli/packages/core/src/code_assist/server.ts:284-290 |
19 | 32 | GEMINI_CLI_AUTH_HEADERS = { |
20 | | - "User-Agent": "google-api-nodejs-client/9.15.1", |
21 | | - "X-Goog-Api-Client": "gl-node/22.17.0", |
22 | | - "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI", |
| 33 | + "User-Agent": "GeminiCLI/0.26.0 (win32; x64)", |
| 34 | + # ------------------------------------------------------------------------- |
| 35 | + # COMMENTED OUT - Not sent by native gemini-cli for OAuth/Code Assist path |
| 36 | + # ------------------------------------------------------------------------- |
| 37 | + # "X-Goog-Api-Client": "gl-node/22.17.0 gdcl/1.30.0", # SDK mimicry - not used by native CLI |
| 38 | + # "Client-Metadata": ( # Sent in body, not as header |
| 39 | + # "ideType=IDE_UNSPECIFIED," |
| 40 | + # "pluginType=GEMINI," |
| 41 | + # "ideVersion=0.26.0," |
| 42 | + # "platform=WINDOWS_AMD64," |
| 43 | + # "updateChannel=stable" |
| 44 | + # ), |
23 | 45 | } |
24 | 46 |
|
25 | 47 |
|
|
0 commit comments