mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Fix GitHub Copilot agent mode with Antigravity
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user