Fix GitHub Copilot agent mode with Antigravity

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
lukmanfauzie
2026-04-26 17:47:13 +08:00
co-authored by Copilot
parent a331c34eab
commit 222e22fa53
5 changed files with 47 additions and 19 deletions
+7
View File
@@ -20,10 +20,17 @@ const NATIVE_PAIRS = {
export function detectClientTool(headers = {}, body = {}) {
const ua = (headers["user-agent"] || "").toLowerCase();
const xApp = (headers["x-app"] || "").toLowerCase();
const openaiIntent = (headers["openai-intent"] || "").toLowerCase();
const initiator = (headers["x-initiator"] || headers["X-Initiator"] || "").toLowerCase();
// Antigravity: detected via body field (not header)
if (body.userAgent === "antigravity") return "antigravity";
// GitHub Copilot / OAI compatible extension using Copilot chat headers
if (ua.includes("githubcopilotchat") || openaiIntent === "conversation-panel" || initiator === "user") {
return "github-copilot";
}
// Claude Code / Claude CLI
if (ua.includes("claude-cli") || ua.includes("claude-code") || xApp === "cli") return "claude";