Skip to content

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

Closed
mukhtharcm wants to merge 1 commit into
openclaw:mainfrom
mukhtharcm:fix/antigravity-resource-exhausted
Closed

fix(antigravity): add CLIProxyAPI v6.6.89 compatibility to fix 429 errors#454
mukhtharcm wants to merge 1 commit into
openclaw:mainfrom
mukhtharcm:fix/antigravity-resource-exhausted

Conversation

@mukhtharcm

Copy link
Copy Markdown
Member

Summary

This PR ports the Antigravity payload enhancements from CLIProxyAPI v6.6.89 to fix RESOURCE_EXHAUSTED (429) errors when using Antigravity.

Problem

When using Antigravity, users were hitting 429 errors:

Cloud Code Assist API error (429): {
  "error": {
    "code": 429,
    "message": "Resource has been exhausted (e.g. check quota).",
    "status": "RESOURCE_EXHAUSTED"
  }
}

Solution

Adapted the fix from NoeFabris/opencode-antigravity-auth#137 which ports CLIProxyAPI v6.6.89 changes.

Changes to @mariozechner/pi-ai patch:

  1. System Instruction Injection

    • Added ANTIGRAVITY_SYSTEM_INSTRUCTION constant with the full Antigravity identity and guidelines text
    • Inject systemInstruction with role: "user" into requests (matches CLIProxyAPI behavior)
    • Prepends the Antigravity identity text to existing system instructions
  2. Request Type

    • Added requestType: "agent" to the wrapped request body for Antigravity requests
  3. User Agent

    • Updated userAgent from "pi-coding-agent" to "antigravity" for Antigravity requests

References

Testing

  • Tested locally - Antigravity requests now work without 429 errors

…rors

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: NoeFabris/opencode-antigravity-auth#137
Reference: router-for-me/CLIProxyAPI@67985d8
@mukhtharcm

mukhtharcm commented Jan 8, 2026

Copy link
Copy Markdown
Member Author

Deployment Note

The Antigravity fix is applied via pnpm patches, so you don't need to rebuild TypeScript to test it.

Quick deployment on VPS:

# Fetch and checkout the PR
git fetch origin pull/454/head:pr-454
git checkout pr-454

# Install dependencies (this applies the @mariozechner/pi-ai patch)
pnpm install

# Run gateway directly without building
pnpm clawdbot gateway

The patch is applied to node_modules/@mariozechner/pi-ai/dist/providers/google-gemini-cli.js during pnpm install, so the fix works immediately even if there are unrelated TypeScript build errors in the main codebase.

Verify the patch was applied:

grep -c "ANTIGRAVITY_SYSTEM_INSTRUCTION" node_modules/@mariozechner/pi-ai/dist/providers/google-gemini-cli.js
# Should output: 2

@steipete

steipete commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Uff... I am not a fan. But let's roll with it for now. Thanks!

@mukhtharcm

Copy link
Copy Markdown
Member Author

Uff... I am not a fan. But let's roll with it for now. Thanks!

sorry, but I only have access to antigravity :)

that's why.

I also saw people struggling in the github soooo

@steipete

steipete commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Landed via temp branch. Ported Antigravity request metadata into current pi-ai patch + updated patch hash and changelog. Tests: pnpm lint, pnpm build, pnpm test. Merged commits: 80ca04a, 5a1c418. Thanks @mukhtharcm!

mcinteerj added a commit to mcinteerj/openclaw that referenced this pull request Jan 9, 2026
- Upgrade @mariozechner/pi-* packages from 0.38.0 to 0.40.0
- Remove pi-ai patch (upstream 429 fix in 0.40.0 supersedes PR openclaw#454)
- Update CHANGELOG
mcinteerj added a commit to mcinteerj/openclaw that referenced this pull request Jan 9, 2026
- Upgrade @mariozechner/pi-* packages from 0.38.0 to 0.40.0
- Remove pi-ai patch (upstream 429 fix in 0.40.0 supersedes PR openclaw#454)
- Update CHANGELOG
steipete pushed a commit that referenced this pull request Jan 9, 2026
- Upgrade @mariozechner/pi-* packages from 0.38.0 to 0.40.0
- Remove pi-ai patch (upstream 429 fix in 0.40.0 supersedes PR #454)
- Update CHANGELOG
steipete pushed a commit to mukhtharcm/clawdbot that referenced this pull request Jan 9, 2026
When Antigravity returns 429, throw immediately instead of waiting for the
server-provided retry delay (which can be 10+ minutes). This lets clawdbot
quickly rotate to another account.

This patch was previously in PR openclaw#454 but was accidentally removed in 0dbb569
when bumping to pi-ai 0.40.0. The upstream release did NOT include this fix.

Context: Antigravity rate limits cause pi-ai to sleep for the full retry
delay inside the request, blocking the thread. Clawdbot's timeout would
eventually fire, but waiting 10+ minutes is unacceptable UX.

Bundled with the empty error message filter since both handle 429 recovery.
ddupg added a commit to ddupg/openclaw that referenced this pull request Mar 1, 2026
Add storageOptions config for S3/GCS/Azure cloud object storage backends.
Pass storageOptions to LanceDB connection; skip resolvePath for cloud URIs.

PR: openclaw#454

Co-authored-by: Ddupg <[email protected]>
ddupg pushed a commit to ddupg/openclaw that referenced this pull request Mar 1, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
- Upgrade @mariozechner/pi-* packages from 0.38.0 to 0.40.0
- Remove pi-ai patch (upstream 429 fix in 0.40.0 supersedes PR openclaw#454)
- Update CHANGELOG
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
When Antigravity returns 429, throw immediately instead of waiting for the
server-provided retry delay (which can be 10+ minutes). This lets clawdbot
quickly rotate to another account.

This patch was previously in PR openclaw#454 but was accidentally removed in b785f8d
when bumping to pi-ai 0.40.0. The upstream release did NOT include this fix.

Context: Antigravity rate limits cause pi-ai to sleep for the full retry
delay inside the request, blocking the thread. Clawdbot's timeout would
eventually fire, but waiting 10+ minutes is unacceptable UX.

Bundled with the empty error message filter since both handle 429 recovery.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
- Upgrade @mariozechner/pi-* packages from 0.38.0 to 0.40.0
- Remove pi-ai patch (upstream 429 fix in 0.40.0 supersedes PR openclaw#454)
- Update CHANGELOG
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
When Antigravity returns 429, throw immediately instead of waiting for the
server-provided retry delay (which can be 10+ minutes). This lets clawdbot
quickly rotate to another account.

This patch was previously in PR openclaw#454 but was accidentally removed in 0beaa5f
when bumping to pi-ai 0.40.0. The upstream release did NOT include this fix.

Context: Antigravity rate limits cause pi-ai to sleep for the full retry
delay inside the request, blocking the thread. Clawdbot's timeout would
eventually fire, but waiting 10+ minutes is unacceptable UX.

Bundled with the empty error message filter since both handle 429 recovery.
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.

2 participants