Skip to content

Getting invalid_request_body when using GitHub Copilot Chat #57776

@BrendanThompson

Description

@BrendanThompson

Reproduction steps

  1. Open Agent thread
  2. Select any GitHub Copilot model
  3. Make a Write request

Current vs. Expected behavior

Current

I get the following error:

Failed to connect to API: 400 Bad Request {"error":{"message":"","code":"invalid_request_body"}}

Expected

Complete the request

Zed version and system specs

Zed: v1.4.2+preview.290.29542ace02a1b17b6805fd0b9674a8154360feb6 (Zed Preview)
OS: macOS 26.5
Memory: 128 GiB
Architecture: aarch64

Attach Zed log file

Zed.log
2026-05-27T13:53:51+10:00 ERROR [agent] Failed to authenticate provider: ChatGPT Subscription: Sign in with your ChatGPT Plus or Pro subscription to use this provider.
2026-05-27T13:53:53+10:00 INFO  [git::repository] opening git repository at "/Users/brendanthompson/.dotfiles/oh-my-zsh/.git" using git binary "/opt/homebrew/bin/git"
2026-05-27T13:53:53+10:00 INFO  [git::repository] opening git repository at "/Users/brendanthompson/.dotfiles/.git" using git binary "/opt/homebrew/bin/git"
2026-05-27T13:53:53+10:00 INFO  [lsp] starting language server process. binary path: "/Users/brendanthompson/Library/Application Support/Zed/extensions/work/typos/typos-lsp-v0.1.52/typos-lsp", working directory: "/Users/brendanthompson/.dotfiles", args: []
2026-05-27T13:54:03+10:00 INFO  [project::lsp_store] stopping language server typos
2026-05-27T13:55:03+10:00 INFO  [lsp] starting language server process. binary path: "/Users/brendanthompson/Library/Application Support/Zed/extensions/work/typos/typos-lsp-v0.1.52/typos-lsp", working directory: "/Users/brendanthompson/.dotfiles", args: []
2026-05-27T13:55:03+10:00 INFO  [agent] Received prompt request for session: afa9f2e2-db30-4171-b07c-8fc0105433b3
2026-05-27T13:55:03+10:00 INFO  [agent::thread] Thread::send called with model: GPT-5.4
2026-05-27T13:55:04+10:00 INFO  [lsp] starting language server process. binary path: "/Users/brendanthompson/.nvm/versions/node/v23.0.0/bin/node", working directory: "/Users/brendanthompson/.dotfiles", args: ["/Users/brendanthompson/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-langservers-extracted/bin/vscode-json-language-server", "--stdio"]
2026-05-27T13:55:04+10:00 INFO  [language] found user-installed language server for ruff. path: "/opt/homebrew/bin/ruff", arguments: ["server"]
2026-05-27T13:55:38+10:00 ERROR [agent::thread] Turn execution failed: Failed to connect to API: 400 Bad Request {"error":{"message":"","code":"invalid_request_body"}}

2026-05-27T13:55:38+10:00 ERROR [agent] Error in model response stream: Failed to connect to API: 400 Bad Request {"error":{"message":"","code":"invalid_request_body"}}

2026-05-27T13:55:38+10:00 ERROR [acp_thread] Error in run turn: Failed to connect to API: 400 Bad Request {"error":{"message":"","code":"invalid_request_body"}}

Relevant Zed settings

settings.json
{
  "language_models": {
    "openai_compatible": {
      "Cerebras": {
        "api_url": "https://api.cerebras.ai/v1",
        "available_models": [
          {
            "name": "llama-3.3-70b",
            "max_tokens": 200000,
            "max_output_tokens": 32000,
            "max_completion_tokens": 200000,
            "capabilities": {
              "tools": true,
              "images": false,
              "parallel_tool_calls": false,
              "prompt_cache_key": false,
            },
          },
        ],
      },
    },
  },
  "context_servers": {
    "cupertino": {
      "enabled": true,
      "command": "/opt/homebrew/bin/cupertino",
      "args": ["serve"],
    },
  },
  "agent": {
    "inline_assistant_model": {
      "provider": "copilot_chat",
      "model": "gpt-5.4",
      "enable_thinking": false,
    },
    "favorite_models": [
      {
        "provider": "copilot_chat",
        "model": "gpt-5.4",
        "enable_thinking": true,
      },
    ],
    "commit_message_model": {
      "provider": "copilot_chat",
      "model": "GPT-5.4",
    },
    "tool_permissions": {
      "tools": {
        "terminal": {
          "always_allow": [
            {
              "pattern": "^swift\\s+(build|test|run|package)"
            },
            {
              "pattern": "^npm\\s+(install|test|run|build)"
            },
            {
              "pattern": "^git\\s+(status|log|diff|branch)"
            },
            {
              "pattern": "^ls\\b"
            },
            {
              "pattern": "^cat\\s"
            },
            {
              "pattern": "^tail\\s"
            },
            {
              "pattern": "^head\\s"
            },
            {
              "pattern": "^grep\\s"
            },
            {
              "pattern": "^wc\\s"
            }
          ],
          "always_deny": [{ "pattern": "rm\\s+-rf\\s+(/|~)" }, { "pattern": "sudo\\s+" }],
        },
        "edit_file": {
          "always_deny": [
            { "pattern": "\\.env" },
            { "pattern": "secrets?/" },
            { "pattern": "\\.(pem|key)$" },
          ],
          "always_allow": [
            { "pattern": "\\.(md|txt|json)$" },
            { "pattern": "\\.(swift)$" },
            { "pattern": "\\.(go)$" },
            { "pattern": "\\.(tf)$" },
          ],
        },
        "fetch": {
          "always_allow": [
            {
              "pattern": "github\\.com"
            },
            {
              "pattern": "apple\\.com"
            },
            {
              "pattern": "swiftpackageindex\\.com"
            },
            {
              "pattern": "raw\\.githubusercontent\\.com"
            }
          ],
        },
        "mcp:cupertino:read_sample": {
          "default": "allow",
        },
        "mcp:cupertino:read_document": {
          "default": "allow",
        },
        "mcp:cupertino:search": {
          "default": "allow",
        },
      },
    },
    "default_model": {
      "effort": "high",
      "enable_thinking": true,
      "provider": "copilot_chat",
      "model": "gpt-5.4",
    },
    "button": false,
    "default_profile": "ask",
    "model_parameters": [],
    "default_width": 600,
    "show_turn_stats": true,
    "notify_when_agent_waiting": "all_screens",
    "sidebar_side": "right",
    "enable_feedback": false,
    "dock": "right",
  },
  "debugger": {
    "button": false,
  },
  "search": {
    "button": false,
  },
  "terminal": {
    "button": false,
    "dock": "bottom",
    "font_family": "BerkeleyMono Nerd Font Mono",
    "default_width": 600,
  },
  "collaboration_panel": {
    "button": false,
    "dock": "left",
    "default_width": 600,
  },
  "outline_panel": {
    "button": false,
    "dock": "left",
    "default_width": 600,
  },
  "git_panel": {
    "tree_view": false,
    "button": false,
    "dock": "left",
    "default_width": 600,
  },
  "project_panel": {
    "button": false,
    "dock": "left",
    "default_width": 600,
  },
  "close_panel_on_toggle": true,
  "global_lsp_settings": {
    "button": false,
  },
  "vim_mode": true,
  "vim": {
    "use_system_clipboard": "never",
  },
  "indent_guides": {
    "enabled": true,
    "coloring": "indent_aware",
    "background_coloring": "disabled",
  },
  "relative_line_numbers": "enabled",
  "telemetry": {
    "diagnostics": false,
    "metrics": false,
  },
  "autosave": "on_focus_change",
  "theme": {
    "mode": "system",
    "light": "Warm Burnout Light",
    "dark": "Warm Burnout Dark",
  },
  "theme_overrides": {
    "Tokyo Night Light": {
      "vim.normal.background": "#2563eb",
      "vim.normal.foreground": "#eff6ff",
      "vim.insert.background": "#059669",
      "vim.insert.foreground": "#ecfdf5",
      "vim.replace.background": "#dc2626",
      "vim.replace.foreground": "#fef2f2",
      "vim.visual.background": "#a855f7",
      "vim.visual.foreground": "#faf5ff",
      "vim.visual_block.background": "#a855f7",
      "vim.visual_block.foreground": "#faf5ff",
      "vim.visual_line.background": "#a855f7",
      "vim.visual_line.foreground": "#faf5ff",
      "vim.helix_jump_label.foreground": "#2563eb",
    },
    "Tokyo Night Storm": {
      "vim.normal.foreground": "#2563eb",
      "vim.normal.background": "#eff6ff",
      "vim.insert.foreground": "#059669",
      "vim.insert.background": "#ecfdf5",
      "vim.replace.foreground": "#dc2626",
      "vim.replace.background": "#fef2f2",
      "vim.visual.foreground": "#a855f7",
      "vim.visual.background": "#faf5ff",
      "vim.visual_block.foreground": "#a855f7",
      "vim.visual_block.background": "#faf5ff",
      "vim.visual_line.foreground": "#a855f7",
      "vim.visual_line.background": "#faf5ff",
      "vim.helix_jump_label.foreground": "#2563eb",
    },
    "Warm Burnout Light": {
      "vim.normal.background": "#2563eb",
      "vim.normal.foreground": "#eff6ff",
      "vim.insert.background": "#059669",
      "vim.insert.foreground": "#ecfdf5",
      "vim.replace.background": "#dc2626",
      "vim.replace.foreground": "#fef2f2",
      "vim.visual.background": "#a855f7",
      "vim.visual.foreground": "#faf5ff",
      "vim.visual_block.background": "#a855f7",
      "vim.visual_block.foreground": "#faf5ff",
      "vim.visual_line.background": "#a855f7",
      "vim.visual_line.foreground": "#faf5ff",
      "vim.helix_jump_label.foreground": "#2563eb",
    },
    "Warm Burnout Dark": {
      "vim.normal.foreground": "#2563eb",
      "vim.normal.background": "#eff6ff",
      "vim.insert.foreground": "#059669",
      "vim.insert.background": "#ecfdf5",
      "vim.replace.foreground": "#dc2626",
      "vim.replace.background": "#fef2f2",
      "vim.visual.foreground": "#a855f7",
      "vim.visual.background": "#faf5ff",
      "vim.visual_block.foreground": "#a855f7",
      "vim.visual_block.background": "#faf5ff",
      "vim.visual_line.foreground": "#a855f7",
      "vim.visual_line.background": "#faf5ff",
      "vim.helix_jump_label.foreground": "#2563eb",
    },
  },
  "experimental.theme_overrides": {
    "syntax": {
      "constant.comment.todo": {
        "color": "#4078f2ff",
      },
      "string.comment.info": {
        "color": "#50a14fff",
      },
      "keyword.comment.warn": {
        "color": "#c18401ff",
      },
      "property.comment.error": {
        "color": "#ca1243ff",
      },
      "emphasis.comment.user": {
        "color": "#000000dd",
      },
    },
  },
  "icon_theme": "Bearded Icon Theme",
  "ui_font_size": 18,
  "ui_font_family": "BerkeleyMono Nerd Font Mono",
  "buffer_font_size": 18,
  "buffer_font_family": "BerkeleyMono Nerd Font Mono",
  "edit_predictions": {
    "allow_data_collection": "no",
    "mode": "subtle",
  },
  "lsp": {
    "terraform-ls": {
      "initialization_options": {
        "experimentalFeatures": {
          "prefillRequiredFields": true,
        },
        "validation": {
          "enableEnhancedValidation": true,
        },
      },
    },
    "typos": {
      "initialization_options": {
        "config": "~/.dotfiles/zed/typos.toml",
        "diagnosticSeverity": "Information",
      },
    },
    "tailwindcss-language-server": {
      "settings": {
        "includeLanguages": {
          "gohtml": "html",
        },
        "experimental": {
          "classRegex": ["class=\"([^\"]*)\"", "className=\"([^\"]*)\""],
        },
      },
    },
  },
  // Extensions
  "auto_install_extensions": {
    "astro": true,
    "bearded-icon-theme": true,
    "bicep": true,
    "cue": true,
    "dockerfile": true,
    "git-firely": true,
    "helm": true,
    "html": true,
    "ini": true,
    "lua": true,
    "make": true,
    "mermaid": true,
    "rego": true,
    "sql": true,
    "ssh-config": true,
    "swift": true,
    "tailwind-theme": true,
    "terraform": true,
    "tokyo-night": true,
    "toml": true,
    "tree-sitter-query": true,
    "typos": true,
    "log": true,
    "xml": true,
  },
  "restore_on_startup": "launchpad",
  "restore_on_file_reopen": false,
  "soft_wrap": "bounded",
  "cursor_shape": "hollow",
  "tab_bar": {
    "show": false,
    "show_tab_bar_buttons": false,
    "show_nav_history_buttons": false,
  },
  "tabs": {
    "show_diagnostics": "all",
    "activate_on_close": "neighbour",
    "git_status": true,
    "file_icons": true,
  },
  "title_bar": {
    "show_branch_status_icon": true,
    "show_sign_in": false,
    "show_user_picture": false,
    "show_menus": false,
  },
  "file_types": {
    "Dockerfile": ["Dockerfile", "Dockerfile.*"],
    "Git Attributes": ["{git,.git,.git/info}/attributes"],
    "Git Config": ["{git,.git/modules,.git/modules/*}/config"],
    "Git Ignore": ["{git,.git}/ignore", ".git/info/exclude"],
    // "HTML": ["*.gohtml"],
    "JSON": ["json", "*.code-snippets"],
    "JSONC": ["jsonc", "hujson"],
    "Ruby": ["Brewfile.personal", "Brewfile.work"],
    "Shell Script": ["*xcrc"],
    "SSH Config": ["**/*ssh/config"],
  },
  "toolbar": {
    "quick_actions": false,
    "breadcrumbs": true,
  },
  "formatter": "auto",
  "preferred_line_length": 100,
  "show_wrap_guides": true,
  "wrap_guides": [100],
  "inlay_hints": {
    "enabled": true,
    "show_type_hints": true,
    "show_parameter_hints": true,
    "show_other_hints": true,
  },
  "max_tabs": 1,
  "remove_trailing_whitespace_on_save": true,
  "ensure_final_newline_on_save": true,
  "diagnostics_max_severity": "hint",
  "diagnostics": {
    "button": true,
    "include_warnings": true,
    "lsp_pull_diagnostics": {
      "enabled": true,
      "debounce_ms": 50,
    },
    "inline": {
      "enabled": true,
      "update_debounce_ms": 150,
      "padding": 4,
      "min_column": 0,
      "max_severity": "all",
    },
  },
  "git": {
    "git_gutter": "tracked_files",
    "inline_blame": {
      "enabled": true,
      "show_commit_summary": true,
    },
  },
  "languages": {
    "Swift": {
      "enable_language_server": true,
      "debuggers": ["lldb"],
      "language_servers": ["sourcekit-lsp", "package-swift-lsp"],
      "formatter": {
        "external": {
          "command": "swiftformat",
          "arguments": ["stdin", "--stdinpath", "{buffer_path}"],
        },
      },
      "format_on_save": "on",
      "tab_size": 2,
    },
    "Mustache": {
      "formatter": "prettier",
    },
    "Python": {
      "language_servers": ["ty", "!basedpyright"],
      "code_actions_on_format": {
        "source.organizeImports.ruff": true,
      },
      "formatter": {
        "language_server": {
          "name": "ruff",
        },
      },
    },
    "Go HTML Template": {
      "language_servers": [
        "tailwindcss-language-server",
        "vscode-html-language-server",
        "emmet-language-server",
        "...",
      ],
    },
    "Terraform": {
      "language_servers": ["terraform-ls", "ms-terraform-lsp"],
    },
  },
  "hide_mouse": "on_typing_and_action",
  "scrollbar": {
    "show": "never",
  },
  "file_scan_exclusions": [
    "**/.git",
    "**/.svn",
    "**/.hg",
    "**/CVS",
    "**/.DS_Store",
    "**/Thumbs.db",
    "**/.classpath",
    "**/.settings",
    "**/out",
    "**/dist",
    "**/.husky",
    "**/.turbo",
    "**/.vscode-test",
    "**/.vscode",
    "**/.next",
    "**/.storybook",
    "**/.tap",
    "**/.nyc_output",
    "**/.terraform",
    "**/node_modules",
    "**/vendor",
    "**/.build",
    "**/*.xcodeproj",
    "**/*.playground",
  ],
  "calls": {
    "mute_on_join": true,
  },
  "file_finder": {
    "modal_max_width": "medium",
  },
  "base_keymap": null,
  "auto_signature_help": true,
  "auto_update": true,
  "show_signature_help_after_edits": true,
  "use_system_path_prompts": false,
  "use_system_prompts": true,
  "resize_all_panels_in_dock": ["left", "right", "bottom"],
  "redact_private_values": true,
  "preview_tabs": {
    "enabled": true,
    "enable_keep_preview_on_code_navigation": true,
    "enable_preview_from_file_finder": true,
  },
  "status_bar": {
    "cursor_position_button": false,
  },
  "cli_default_open_behavior": "new_window",
  "completion_menu_item_kind": "symbol",
  "profiles": {
    "AI Disabled": {
      "settings": {
        "agent": {
          "enabled": false,
        },
      },
    },
  },
  "code_lens": "on",
}

Relevant Keymap

keymap.json

(for AI issues) Model provider details

  • Provider: Copilot Chat
  • Model Name: GPT-5.4
  • Mode: Agent Panel

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aiRelated to Agent Panel, Edit Prediction, Copilot, or other AI featuresfrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P1Security holes w/o exploit, crash, install/update, sign-in, badly broken common featuresstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions