Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.

feat: add CLIProxyAPI v6.6.89 Antigravity compatibility to fix antigravity usage#137

Merged
tctinh merged 7 commits into
NoeFabris:devfrom
happycastle114:fix/antigravity-v6.6.89-compat
Jan 8, 2026
Merged

feat: add CLIProxyAPI v6.6.89 Antigravity compatibility to fix antigravity usage#137
tctinh merged 7 commits into
NoeFabris:devfrom
happycastle114:fix/antigravity-v6.6.89-compat

Conversation

@happycastle114

@happycastle114 happycastle114 commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR ports the Antigravity payload enhancements from CLIProxyAPI v6.6.89 to maintain compatibility with the latest Antigravity API changes.

Changes

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

Reference

Commit from CLIProxyAPI: router-for-me/CLIProxyAPI@67985d8

feat(executor): enhance Antigravity payload with user role and dynamic system instructions

Testing

  • Build passes (npm run build)
  • No TypeScript errors

Summary by CodeRabbit

  • New Features

    • Added an "Antigravity" system-instruction template and support to apply it to Antigravity requests.
    • Antigravity flows now mark the request payload as an agent request.
  • Bug Fixes

    • Ensured the Antigravity instruction is injected consistently regardless of incoming request shape.

✏️ Tip: You can customize this high-level summary in your review settings.

tctinh and others added 4 commits January 2, 2026 23:10
Added troubleshooting section for common issues related to multi-account authentication, Gemini model not found, and session errors.
Update model names in README.md
Port Antigravity payload enhancements from CLIProxyAPI v6.6.89:
- Add systemInstruction with role 'user' and Antigravity identity text
- Add requestType: 'agent' to wrapped request body
- Add ANTIGRAVITY_SYSTEM_INSTRUCTION constant with full identity/guidelines

Reference: router-for-me/CLIProxyAPI@67985d8
@coderabbitai

coderabbitai Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR duplicates the ANTIGRAVITY_SYSTEM_INSTRUCTION constant export in src/constants.ts and updates src/plugin/request.ts to import this instruction, injecting it into request payloads when headerStyle is "antigravity" while setting requestType to "agent".

Changes

Cohort / File(s) Summary
Constant definition
src/constants.ts
Adds ANTIGRAVITY_SYSTEM_INSTRUCTION export twice (identical large payloads) (+90 lines).
Antigravity request handling
src/plugin/request.ts
Imports ANTIGRAVITY_SYSTEM_INSTRUCTION; modifies prepareAntigravityRequest to inject/merge the instruction into requestPayload.systemInstruction when headerStyle === "antigravity" (handles object/string/absent cases); sets requestType: "agent" in returned payload; injection applied at two normalization points (+32/-1 lines).
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding Antigravity compatibility to fix antigravity usage in alignment with CLIProxyAPI v6.6.89, matching the core objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/constants.ts:
- Around line 140-228: The ANTIGRAVITY_SYSTEM_INSTRUCTION string has
content-quality problems: fix the numbering duplicate (three "4" entries) under
"Design Aesthetics" so list items are correctly numbered/ordered, change
"Javascript" to "JavaScript" in the "Core" tech stack section, and remove
unintended trailing commas from section headers and list introductions (e.g.,
after "## Technology Stack,", "Design Aesthetics,", and "Implementation
Workflow,", etc.) to make punctuation consistent; keep the overall intent but
trim or consider collapsing non-essential long guidelines to reduce the
constant's size if possible.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 1db144b and f2215b9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/constants.ts
  • src/plugin/request.ts
🧰 Additional context used
🧬 Code graph analysis (1)
src/plugin/request.ts (1)
src/constants.ts (1)
  • ANTIGRAVITY_SYSTEM_INSTRUCTION (149-228)
🔇 Additional comments (4)
src/plugin/request.ts (3)

48-48: LGTM - Import added correctly.

The import of ANTIGRAVITY_SYSTEM_INSTRUCTION is properly structured and positioned with related constants.


1284-1284: LGTM - Request type correctly set.

Setting requestType: "agent" aligns with the CLIProxyAPI v6.6.89 compatibility objective.


1250-1278: Verify the CLIProxyAPI v6.6.89 API contract for systemInstruction.role.

The injection logic sets systemInstruction.role = "user" per CLIProxyAPI v6.6.89 compatibility requirements, but this is non-standard (most APIs expect role: "system"). The input handling (object with parts, plain string, or missing instruction) is correct, and the logic properly prepends the 79-line ANTIGRAVITY_SYSTEM_INSTRUCTION consistently.

However, verify that the Antigravity API contract actually accepts role: "user" for system instructions—this setting is unusual and warrants confirmation against CLIProxyAPI v6.6.89 documentation or API behavior.

The 79-line instruction prepended to every request will increase token consumption. Monitor for context-length errors in production.

src/constants.ts (1)

149-228: The AI summary incorrectly claims duplication of ANTIGRAVITY_SYSTEM_INSTRUCTION.

Only a single export of ANTIGRAVITY_SYSTEM_INSTRUCTION exists at line 149 in src/constants.ts. The summary's assertion that it was "duplicated twice" is inaccurate.

Comment thread src/constants.ts
@happycastle114 happycastle114 changed the title feat: add CLIProxyAPI v6.6.89 Antigravity compatibility feat: add CLIProxyAPI v6.6.89 Antigravity compatibility to fix antigravity usage Jan 8, 2026
- Fix 'Javascript' → 'JavaScript' capitalization
- Fix duplicate numbering (4, 4) → (4, 5) in Design Aesthetics
- Remove trailing commas from section headers and list items
- Normalize indentation (tabs → spaces)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/constants.ts:
- Line 150: Replace the incorrect brand capitalization "Google Deepmind" with
the correct "Google DeepMind" wherever that literal appears (e.g., the string on
line containing "You are Antigravity, a powerful agentic AI coding assistant
designed by the Google Deepmind team") so the constant/string uses the official
brand capitalization.
🧹 Nitpick comments (1)
src/constants.ts (1)

178-178: Fix verb form for parallel structure.

Line 178 uses "Using modern typography" (present participle) while surrounding bullets use imperative verbs ("Avoid", "Use", "Add"). This breaks parallel structure.

✏️ Proposed fix
-   - Using modern typography (e.g., from Google Fonts like Inter, Roboto, or Outfit) instead of browser defaults.
+   - Use modern typography (e.g., from Google Fonts like Inter, Roboto, or Outfit) instead of browser defaults.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between f2215b9 and 3e3371b.

📒 Files selected for processing (1)
  • src/constants.ts
🔇 Additional comments (3)
src/constants.ts (3)

140-148: LGTM! Clear documentation of the new constant.

The comment structure and JSDoc clearly document the purpose and origin of this system instruction constant.


217-228: LGTM! Clear agent behavior guidelines.

The ephemeral message and communication style sections provide clear, actionable guidelines for agent behavior and user interaction.


164-164: Past content issues have been resolved.

The previous review identified several content quality issues that have been addressed in the current version:

  • Line 164 now correctly uses "JavaScript" (capital S)
  • Lines 182-183 show correct sequential numbering (items 4 and 5, not three items numbered "4")
  • Section headers no longer have trailing commas

Good work addressing the feedback!

Also applies to: 182-183

Comment thread src/constants.ts Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/constants.ts (1)

161-207: Consider standardizing markdown header levels.

The instruction uses inconsistent header levels: "Design Aesthetics" uses # (line 174) while "Technology Stack" (line 161), "Implementation Workflow" (line 185), and "SEO Best Practices" (line 207) use ##. Standardizing to the same level would improve consistency when rendered.

♻️ Proposed fix for header consistency
-# Design Aesthetics
+## Design Aesthetics
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3e3371b and 1566fbe.

📒 Files selected for processing (1)
  • src/constants.ts
🔇 Additional comments (1)
src/constants.ts (1)

140-229: Past issues successfully addressed.

The constant has been properly implemented with the fixes from previous review feedback applied:

  • "JavaScript" is now correctly capitalized (line 164)
  • "Google DeepMind" uses proper brand capitalization (line 150)
  • Numbering under "Design Aesthetics" is now sequential: 4, 5 (lines 182-183)

The large instruction payload matches the CLIProxyAPI v6.6.89 reference and serves the intended purpose of providing identity and guidelines for Antigravity requests.

@mrevanzak

Copy link
Copy Markdown

can we merge this ASAP 😂

@vquanghuy

Copy link
Copy Markdown

Tested and worked perfectly on my end. Great work 🙏

@linuxmobile

Copy link
Copy Markdown

Working perfect here!

@ianchenx

ianchenx commented Jan 8, 2026

Copy link
Copy Markdown

The new version, in combination with the ultrawork mode of oh my opencode, can easily lead to overly long context

mukhtharcm added a commit to mukhtharcm/clawdbot that referenced this pull request Jan 8, 2026
…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
@tctinh
tctinh changed the base branch from main to dev January 8, 2026 05:18
irishavmishra referenced this pull request in irishavmishra/opencode-antigravity-auth Jan 8, 2026
- Add ANTIGRAVITY_SYSTEM_INSTRUCTION constant for system identity
- Inject system instruction with role 'user' for Antigravity requests
- Add requestType 'agent' field to wrapped request body
- Maintains compatibility with latest Antigravity API changes
- Reference: PR #137 from NoeFabris/opencode-antigravity-auth
@tctinh
tctinh merged commit 97d0f99 into NoeFabris:dev Jan 8, 2026
1 check passed
steipete pushed a commit to openclaw/openclaw that referenced this pull request Jan 8, 2026
…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
@tctinh

tctinh commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for your great works, PR merge, release on 1.2.8

ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…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
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…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
shtse8 pushed a commit to SylphxAI/openclaw that referenced this pull request Jul 15, 2026
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants