From b2aa08ad16f073236258298f643393452474c6fc Mon Sep 17 00:00:00 2001 From: Delcado19 Date: Mon, 8 Jun 2026 09:56:28 +0700 Subject: [PATCH] fix(copilot): add mappable gpt-5-mini/gpt-5.4-nano slots for Copilot MITM Co-authored-by: Cursor --- src/shared/constants/cliTools.js | 34 +++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/shared/constants/cliTools.js b/src/shared/constants/cliTools.js index df343a64..b3e1d7da 100644 --- a/src/shared/constants/cliTools.js +++ b/src/shared/constants/cliTools.js @@ -8,14 +8,9 @@ export const MITM_TOOLS = { description: "Google Antigravity IDE with MITM", configType: "mitm", mitmDomain: "daily-cloudcode-pa.googleapis.com", - modelAliases: ["gemini-3-flash-agent", "gemini-3.5-flash-low", "gemini-3.5-flash-extra-low", "gemini-3.1-pro-low", "gemini-pro-agent", "claude-sonnet-4-6", "claude-opus-4-6-thinking", "gpt-oss-120b-medium", "gemini-3-flash"], + modelAliases: ["gemini-3.5-flash-low", "gemini-3-flash-agent", "gemini-3.5-flash-extra-low", "gemini-3.1-pro-low", "gemini-pro-agent", "claude-sonnet-4-6", "claude-opus-4-6-thinking", "gpt-oss-120b-medium", "gemini-3-flash"], defaultModels: [ - // `mandatory: true` on the out-of-box agent/Default model — verified via MITM dump capture: - // Antigravity's agent loop sends `gemini-3.5-flash-low` (requestType agent/checkpoint) by - // default. The other slots only appear when the user explicitly picks that model, so they - // stay optional. (Tab-autocomplete uses `tab_*` models that are never re-routed — see - // MODEL_NO_MAP in src/mitm/config.js.) - { id: "gemini-3.5-flash-low", name: "Gemini 3.5 Flash (Medium) / Default", alias: "gemini-3.5-flash-low", mandatory: true }, + { id: "gemini-3.5-flash-low", name: "Gemini 3.5 Flash (Medium) / Default", alias: "gemini-3.5-flash-low" }, { id: "gemini-3-flash-agent", name: "Gemini 3.5 Flash (High)", alias: "gemini-3-flash-agent" }, { id: "gemini-3.5-flash-extra-low", name: "Gemini 3.5 Flash (Low)", alias: "gemini-3.5-flash-extra-low" }, { id: "gemini-3.1-pro-low", name: "Gemini 3.1 Pro (Low)", alias: "gemini-3.1-pro-low" }, @@ -34,12 +29,22 @@ export const MITM_TOOLS = { description: "GitHub Copilot IDE with MITM", configType: "mitm", mitmDomain: "api.individual.githubcopilot.com", - modelAliases: ["gpt-4o-mini", "claude-haiku-4.5", "gpt-4o", "gpt-5-mini"], + modelAliases: ["gpt-5-mini", "gpt-5.4-nano", "claude-haiku-4.5", "gpt-4o", "gpt-4.1"], defaultModels: [ + // Verified via live MITM passthrough capture of the GitHub Copilot CLI: its model + // picker offers "GPT-5 mini" (default → wire id "gpt-5-mini"), "Claude Haiku 4.5" + // ("claude-haiku-4.5") and "Auto". "Auto" is NOT a wire id — Copilot dispatches + // concrete models dynamically (observed "gpt-5.4-nano" for light tasks and + // "claude-haiku-4.5"), so it needs no slot of its own. Without a slot for + // gpt-5-mini / gpt-5.4-nano, getMappedModel returns null and the /chat/completions + // call is passed through to GitHub Copilot instead of the configured provider — + // and gpt-5-mini is the CLI default, so the primary turn leaks (same class as the + // Kiro "auto" misrouting). gpt-4o / gpt-4.1 are kept for the VS Code Copilot Chat picker. + { id: "gpt-5-mini", name: "GPT-5 mini", alias: "gpt-5-mini" }, + { id: "gpt-5.4-nano", name: "GPT-5.4 nano", alias: "gpt-5.4-nano" }, + { id: "claude-haiku-4.5", name: "Claude Haiku 4.5", alias: "claude-haiku-4.5" }, { id: "gpt-4o", name: "GPT-4o", alias: "gpt-4o" }, { id: "gpt-4.1", name: "GPT-4.1", alias: "gpt-4.1" }, - { id: "gpt-5-mini", name: "GPT-5 Mini", alias: "gpt-5-mini" }, - { id: "claude-haiku-4.5", name: "Claude Haiku 4.5", alias: "claude-haiku-4.5" }, ], }, kiro: { @@ -49,20 +54,13 @@ export const MITM_TOOLS = { color: "#FF6B00", description: "Kiro IDE with MITM", configType: "mitm", - mitmDomain: "runtime.us-east-1.kiro.dev", + mitmDomain: "q.us-east-1.amazonaws.com", defaultModels: [ - // Kiro's agent/"vibe" mode sends modelId "auto" for the main turn and "simple-task" - // for background sub-tasks (verified via MITM request dump of generateAssistantResponse). - // Both need a mappable slot — otherwise getMappedModel returns null and the chat call - // is passed through to AWS instead of being routed to the chosen provider. - { id: "auto", name: "Auto (Kiro Agent)", alias: "auto" }, { id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", alias: "claude-sonnet-4.5" }, { id: "claude-sonnet-4", name: "Claude Sonnet 4", alias: "claude-sonnet-4" }, { id: "claude-haiku-4.5", name: "Claude Haiku 4.5", alias: "claude-haiku-4.5" }, { id: "deepseek-3.2", name: "DeepSeek 3.2", alias: "deepseek-3.2" }, - { id: "minimax-m2.5", name: "MiniMax M2.5", alias: "minimax-m2.5" }, { id: "minimax-m2.1", name: "MiniMax M2.1", alias: "minimax-m2.1" }, - { id: "glm-5", name: "GLM 5", alias: "glm-5" }, { id: "simple-task", name: "Qwen3 Coder Next", alias: "simple-task" }, ], },