You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Claude models (and Gemini Argon) fail with HTTP 400 “request body is not valid JSON”; other models work #5139
I consistently encounter errors when using Claude Sonnet 5.5 and Claude Opus 5.5 in GitHub Copilot CLI. Other models appear to work correctly in the same environment. EDIT: also found similar problems with Gemini Argon model
The issue affects me, but colleagues at the same company do not experience it. I have already performed a clean installation of Copilot CLI, and the problem persists. I have also ruled out MCP servers as the cause.
Environment
• GitHub Copilot CLI: 1.0.97
• OS: macOS, ARM64
• Affected models: Claude Sonnet 5.5 and Claude Opus 5.5
• Provider: GitHub Copilot
Steps to reproduce
Start a Copilot CLI session.
Select Claude Sonnet 5.5 or Claude Opus 5.5.
Send a prompt. Even a simple greeting such as “hola” failed with Opus.
The request fails before any assistant response or tool execution.
Switch to a non-Claude model; the session works.
Expected behavior
Claude models should respond normally, as they do for my colleagues.
Actual behavior
Requests to /v1/messages fail with HTTP 400 and JSON parsing errors.
For Claude Sonnet 5.5, the logs first show two HTTP 408 request-body upload timeouts for a 161,769-byte request. The CLI retries with a fresh connection, then reports:
Execution failed: 400 The request body is not valid JSON:
request body is not valid JSON: decoding JSON body:
invalid character 'p' after object key
For Claude Opus 5.5, the request fails almost immediately:
Execution failed: 400 The request body is not valid JSON:
request body is not valid JSON: decoding JSON body:
invalid character ':' after object key:value pair
Since this persists after a clean installation, affects both Claude models, and does not affect other models or my colleagues, could you investigate whether there is an account-specific or request-routing issue in the Claude integration? The available logs do not establish whether the invalid JSON originates in the CLI or in the service handling the request.
changed the title [-]Claude models fail with HTTP 400 “request body is not valid JSON”; other models work[/-][+]Claude models (and Gemini Argon) fail with HTTP 400 “request body is not valid JSON”; other models work[/+]on Oct 14, 2026
Experiencing similar issue with all claude models :
I’m seeing a GitHub Copilot CLI issue that appears specific to Claude models through the interactive CLI path.
Environment
• macOS
• GitHub Copilot CLI 1.0.98
• Also tested cached older CLI versions, especially 1.0.94
• Models affected:
• claude-sonnet-5.5
• claude-haiku-4.5
• GPT models work normally in interactive mode.
• Direct Copilot API calls to Claude models work.
Primary symptom
When using Claude models in Copilot CLI interactive mode, requests often fail with HTTP 400 malformed JSON errors from the Anthropic /v1/messages path.
Examples:
Execution failed: 400 The request body is not valid JSON:
decoding JSON body: invalid character 't' after object key:value pair
Other observed variants:
invalid escape sequence \e in string
invalid escape sequence \c in string
invalid character 's' after object key:value pair
invalid character '}' after object key
invalid character ':' after object key:value pair
invalid character 'a' after object key:value pair
Second symptom
After reducing the tool surface, the malformed JSON errors mostly stopped, but Claude interactive sessions began hanging and eventually logging upload timeouts:
Model provider request failed {"api_endpoint":"/v1/messages","http_status":408}
Request body upload timed out; retrying the identical request
request_body_bytes=17033 / 19097
The CLI keeps retrying, so from the user perspective it looks like Claude is “thinking” forever.
Troubleshooting performed
Verified model access directly
• Direct Copilot API calls to Claude worked for:
• claude-sonnet-5.5
• claude-opus-5.5
• claude-haiku-4.5
• This suggests the issue is not entitlement, authentication, or Claude availability.
Checked Copilot CLI versions
• Current CLI: 1.0.98
• Tested cached versions:
• 1.0.91
• 1.0.92
• 1.0.93
• 1.0.94
• Older 1.0.94 sometimes avoided the malformed JSON error, but still hit /v1/messages upload timeout in interactive mode.
Checked Copilot OTel/logs
• Used Copilot logs / OTel-style traces.
• Logs consistently point to Anthropic /v1/messages :
Model provider request failed {"stage":"inference","api_endpoint":"/v1/messages","http_status":400}
• Later:
http_status=408
Request body upload timed out
Constrained the tool surface
• Passing --available-tools bash reduced the malformed JSON failures:
copilot --available-tools bash ...
• Note: adding "availableTools": ["bash"] to ~/.copilot/settings.json does not work in 1.0.98 ; logs say:
Ignoring unknown top-level key(s): "availableTools"
• So the flag must be passed explicitly.
Added a local shell wrapper
• Wrapped copilot in ~/.zshrc to inject:
--available-tools bash
• This helped with JSON 400 errors but did not fully fix interactive Claude timeouts.
Compared interactive vs prompt mode
• Claude prompt mode works quickly:
copilot -p "Reply exactly OK" --model claude-haiku-4.5 --context default --allow-all
Result: OK in ~2 seconds.
• Claude interactive mode hangs:
copilot -i hi --model claude-haiku-4.5 --context default --allow-all
Result: /v1/messages upload timeout/retry loop.
Current conclusion
This appears to be a Copilot CLI issue in the Claude interactive request path, likely around request construction/serialization and/or upload handling for Anthropic /v1/messages .
Evidence:
• Claude direct Copilot API calls work.
• Claude copilot -p prompt mode works quickly.
• GPT interactive mode works.
• Claude copilot -i interactive mode either:
• sends malformed JSON to /v1/messages , or
• hangs on request-body upload timeouts.
• Reducing tools with --available-tools bash helps with malformed JSON but not with interactive upload timeout.
Activity
[-]Claude models fail with HTTP 400 “request body is not valid JSON”; other models work[/-][+]Claude models (and Gemini Argon) fail with HTTP 400 “request body is not valid JSON”; other models work[/+]FloRul commentedon Oct 15, 2026
Experiencing similar issue with all claude models :
I’m seeing a GitHub Copilot CLI issue that appears specific to Claude models through the interactive CLI path.
Environment
• macOS
• GitHub Copilot CLI 1.0.98
• Also tested cached older CLI versions, especially 1.0.94
• Models affected:
• claude-sonnet-5.5
• claude-haiku-4.5
• GPT models work normally in interactive mode.
• Direct Copilot API calls to Claude models work.
Primary symptom
When using Claude models in Copilot CLI interactive mode, requests often fail with HTTP 400 malformed JSON errors from the Anthropic /v1/messages path.
Examples:
Execution failed: 400 The request body is not valid JSON:
decoding JSON body: invalid character 't' after object key:value pair
Other observed variants:
invalid escape sequence
\ein stringinvalid escape sequence
\cin stringinvalid character 's' after object key:value pair
invalid character '}' after object key
invalid character ':' after object key:value pair
invalid character 'a' after object key:value pair
Second symptom
After reducing the tool surface, the malformed JSON errors mostly stopped, but Claude interactive sessions began hanging and eventually logging upload timeouts:
Model provider request failed {"api_endpoint":"/v1/messages","http_status":408}
Request body upload timed out; retrying the identical request
request_body_bytes=17033 / 19097
The CLI keeps retrying, so from the user perspective it looks like Claude is “thinking” forever.
Troubleshooting performed
• Direct Copilot API calls to Claude worked for:
• claude-sonnet-5.5
• claude-opus-5.5
• claude-haiku-4.5
• This suggests the issue is not entitlement, authentication, or Claude availability.
• Current CLI: 1.0.98
• Tested cached versions:
• 1.0.91
• 1.0.92
• 1.0.93
• 1.0.94
• Older 1.0.94 sometimes avoided the malformed JSON error, but still hit /v1/messages upload timeout in interactive mode.
• Disabled MCP servers
• Disabled local plugins
• Disabled hooks:
copilot config disableAllHooks true
• Disabled IDE auto-connect:
copilot config ide.autoConnect false
• Disabled terminal title/progress:
copilot config updateTerminalTitle false
copilot config terminalProgress false
• Used Copilot logs / OTel-style traces.
• Logs consistently point to Anthropic /v1/messages :
Model provider request failed {"stage":"inference","api_endpoint":"/v1/messages","http_status":400}
• Later:
http_status=408
Request body upload timed out
• Passing --available-tools bash reduced the malformed JSON failures:
copilot --available-tools bash ...
• Note: adding "availableTools": ["bash"] to ~/.copilot/settings.json does not work in 1.0.98 ; logs say:
Ignoring unknown top-level key(s): "availableTools"
• So the flag must be passed explicitly.
• Wrapped copilot in ~/.zshrc to inject:
--available-tools bash
• This helped with JSON 400 errors but did not fully fix interactive Claude timeouts.
• Claude prompt mode works quickly:
copilot -p "Reply exactly OK" --model claude-haiku-4.5 --context default --allow-all
Result: OK in ~2 seconds.
• Claude interactive mode hangs:
copilot -i hi --model claude-haiku-4.5 --context default --allow-all
Result: /v1/messages upload timeout/retry loop.
Current conclusion
This appears to be a Copilot CLI issue in the Claude interactive request path, likely around request construction/serialization and/or upload handling for Anthropic /v1/messages .
Evidence:
• Claude direct Copilot API calls work.
• Claude copilot -p prompt mode works quickly.
• GPT interactive mode works.
• Claude copilot -i interactive mode either:
• sends malformed JSON to /v1/messages , or
• hangs on request-body upload timeouts.
• Reducing tools with --available-tools bash helps with malformed JSON but not with interactive upload timeout.
Current workaround
For Claude:
copilot -p "your prompt here" --model claude-haiku-4.5 --context default --allow-all
or:
copilot -p "your prompt here" --model claude-sonnet-5.5 --context default --allow-all