fix(antigravity): add CLIProxyAPI v6.6.89 compatibility to fix 429 errors

Port Antigravity payload enhancements from CLIProxyAPI v6.6.89:
- Add ANTIGRAVITY_SYSTEM_INSTRUCTION with agent identity/guidelines
- Inject systemInstruction with role 'user' for Antigravity requests
- Add requestType: 'agent' to wrapped request body
- Update userAgent to 'antigravity' for Antigravity requests

This fixes RESOURCE_EXHAUSTED (429) errors when using Antigravity.

Adapted from: https://github.com/NoeFabris/opencode-antigravity-auth/pull/137
Reference: https://github.com/router-for-me/CLIProxyAPI/commit/67985d8
This commit is contained in:
mukhtharcm
2026-01-08 10:23:46 +05:30
committed by Peter Steinberger
parent 9eb71b1f88
commit 80ca04af01
2 changed files with 153 additions and 8 deletions

10
pnpm-lock.yaml generated
View File

@@ -12,7 +12,7 @@ patchedDependencies:
hash: 01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4
path: patches/@mariozechner__pi-agent-core.patch
'@mariozechner/pi-ai':
hash: 6ecd99d37f67efa165b3cc3163bd28dac3fbc88a33649112ff45daded4007343
hash: 574a0ebc3772ef61f04b6dcffdcda31c7fe6384e6f44ce43dbd7adb3b24ec97a
path: patches/@mariozechner__pi-ai.patch
importers:
@@ -39,7 +39,7 @@ importers:
version: 0.38.0(patch_hash=01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-ai':
specifier: ^0.38.0
version: 0.38.0(patch_hash=6ecd99d37f67efa165b3cc3163bd28dac3fbc88a33649112ff45daded4007343)(ws@8.19.0)(zod@4.3.5)
version: 0.38.0(patch_hash=574a0ebc3772ef61f04b6dcffdcda31c7fe6384e6f44ce43dbd7adb3b24ec97a)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-coding-agent':
specifier: ^0.38.0
version: 0.38.0(ws@8.19.0)(zod@4.3.5)
@@ -3616,7 +3616,7 @@ snapshots:
'@mariozechner/pi-agent-core@0.38.0(patch_hash=01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4)(ws@8.19.0)(zod@4.3.5)':
dependencies:
'@mariozechner/pi-ai': 0.38.0(patch_hash=6ecd99d37f67efa165b3cc3163bd28dac3fbc88a33649112ff45daded4007343)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-ai': 0.38.0(patch_hash=574a0ebc3772ef61f04b6dcffdcda31c7fe6384e6f44ce43dbd7adb3b24ec97a)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-tui': 0.38.0
transitivePeerDependencies:
- '@modelcontextprotocol/sdk'
@@ -3626,7 +3626,7 @@ snapshots:
- ws
- zod
'@mariozechner/pi-ai@0.38.0(patch_hash=6ecd99d37f67efa165b3cc3163bd28dac3fbc88a33649112ff45daded4007343)(ws@8.19.0)(zod@4.3.5)':
'@mariozechner/pi-ai@0.38.0(patch_hash=574a0ebc3772ef61f04b6dcffdcda31c7fe6384e6f44ce43dbd7adb3b24ec97a)(ws@8.19.0)(zod@4.3.5)':
dependencies:
'@anthropic-ai/sdk': 0.71.2(zod@4.3.5)
'@google/genai': 1.34.0
@@ -3650,7 +3650,7 @@ snapshots:
dependencies:
'@mariozechner/clipboard': 0.3.0
'@mariozechner/pi-agent-core': 0.38.0(patch_hash=01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-ai': 0.38.0(patch_hash=6ecd99d37f67efa165b3cc3163bd28dac3fbc88a33649112ff45daded4007343)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-ai': 0.38.0(patch_hash=574a0ebc3772ef61f04b6dcffdcda31c7fe6384e6f44ce43dbd7adb3b24ec97a)(ws@8.19.0)(zod@4.3.5)
'@mariozechner/pi-tui': 0.38.0
chalk: 5.6.2
cli-highlight: 2.1.11