Fix bug antigravity
This commit is contained in:
@@ -74,9 +74,9 @@ export const PROVIDERS = {
|
|||||||
},
|
},
|
||||||
antigravity: {
|
antigravity: {
|
||||||
baseUrls: [
|
baseUrls: [
|
||||||
"https://daily-cloudcode-pa.sandbox.googleapis.com",
|
|
||||||
"https://daily-cloudcode-pa.googleapis.com",
|
"https://daily-cloudcode-pa.googleapis.com",
|
||||||
"https://cloudcode-pa.googleapis.com"
|
"https://cloudcode-pa.googleapis.com",
|
||||||
|
"https://daily-cloudcode-pa.sandbox.googleapis.com"
|
||||||
],
|
],
|
||||||
format: "antigravity",
|
format: "antigravity",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -139,8 +139,11 @@ export const PROVIDERS = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Claude system prompt
|
// Claude system prompt
|
||||||
export const CLAUDE_SYSTEM_PROMPT = "You are Claude Code, Anthropic's official CLI for Claude.";
|
export const CLAUDE_SYSTEM_PROMPT = "You are Claude Code, Anthropic's official CLI for Claude.";
|
||||||
|
|
||||||
|
// Antigravity default system prompt (required for API to work)
|
||||||
|
export const ANTIGRAVITY_DEFAULT_SYSTEM = "Please ignore the following [ignore]You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**[/ignore]";
|
||||||
|
|
||||||
// OAuth endpoints
|
// OAuth endpoints
|
||||||
export const OAUTH_ENDPOINTS = {
|
export const OAUTH_ENDPOINTS = {
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { register } from "../index.js";
|
import { register } from "../index.js";
|
||||||
import { FORMATS } from "../formats.js";
|
import { FORMATS } from "../formats.js";
|
||||||
import { DEFAULT_THINKING_GEMINI_SIGNATURE } from "../../config/defaultThinkingSignature.js";
|
import { DEFAULT_THINKING_GEMINI_SIGNATURE } from "../../config/defaultThinkingSignature.js";
|
||||||
|
import { ANTIGRAVITY_DEFAULT_SYSTEM } from "../../config/constants.js";
|
||||||
|
|
||||||
function generateUUID() {
|
function generateUUID() {
|
||||||
return crypto.randomUUID();
|
return crypto.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DEFAULT_SAFETY_SETTINGS,
|
DEFAULT_SAFETY_SETTINGS,
|
||||||
convertOpenAIContentToParts,
|
convertOpenAIContentToParts,
|
||||||
@@ -239,7 +241,15 @@ function wrapInCloudCodeEnvelope(model, geminiCLI, credentials = null, isAntigra
|
|||||||
// Antigravity specific fields
|
// Antigravity specific fields
|
||||||
if (isAntigravity) {
|
if (isAntigravity) {
|
||||||
envelope.requestType = "agent";
|
envelope.requestType = "agent";
|
||||||
// Remove safetySettings for Antigravity
|
|
||||||
|
// Inject required default system prompt for Antigravity
|
||||||
|
const defaultPart = { text: ANTIGRAVITY_DEFAULT_SYSTEM };
|
||||||
|
if (envelope.request.systemInstruction?.parts) {
|
||||||
|
envelope.request.systemInstruction.parts.unshift(defaultPart);
|
||||||
|
} else {
|
||||||
|
envelope.request.systemInstruction = { role: "user", parts: [defaultPart] };
|
||||||
|
}
|
||||||
|
|
||||||
// Add toolConfig for Antigravity
|
// Add toolConfig for Antigravity
|
||||||
if (geminiCLI.tools?.length > 0) {
|
if (geminiCLI.tools?.length > 0) {
|
||||||
envelope.request.toolConfig = {
|
envelope.request.toolConfig = {
|
||||||
|
|||||||
Reference in New Issue
Block a user