From 59a448b6450fbc3ce2bcc89b82d68bfd45795e49 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Thu, 8 Jan 2026 21:05:33 +0800 Subject: [PATCH] feat(executor): centralize systemInstruction handling for Claude and Gemini-3-Pro models --- internal/runtime/executor/antigravity_executor.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/runtime/executor/antigravity_executor.go b/internal/runtime/executor/antigravity_executor.go index e68fc7b9..44e0d2d8 100644 --- a/internal/runtime/executor/antigravity_executor.go +++ b/internal/runtime/executor/antigravity_executor.go @@ -45,6 +45,7 @@ const ( defaultAntigravityAgent = "antigravity/1.104.0 darwin/arm64" antigravityAuthType = "antigravity" refreshSkew = 3000 * time.Second + systemInstruction = "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**" ) var ( @@ -1049,9 +1050,9 @@ func (e *AntigravityExecutor) buildRequest(ctx context.Context, auth *cliproxyau if strings.Contains(modelName, "claude") || strings.Contains(modelName, "gemini-3-pro-preview") { systemInstructionPartsResult := gjson.GetBytes(payload, "request.systemInstruction.parts") - payload, _ = sjson.SetBytes(payload, "request.systemInstruction.role", "user") - payload, _ = sjson.SetBytes(payload, "request.systemInstruction.parts.0.text", "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**") + payload, _ = sjson.SetBytes(payload, "request.systemInstruction.parts.0.text", systemInstruction) + payload, _ = sjson.SetBytes(payload, "request.systemInstruction.parts.1.text", fmt.Sprintf("Please ignore following [ignore]%s[/ignore]", systemInstruction)) if systemInstructionPartsResult.Exists() && systemInstructionPartsResult.IsArray() { for _, partResult := range systemInstructionPartsResult.Array() {