[BUG] VS Code sidebar chat: API Error 400 - messages[1].role unknown variant system
Resolved 💬 2 comments Opened May 29, 2026 by idea-songyaqi Closed May 29, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The VS Code sidebar chat panel always returns API Error 400. When I send any message in the sidebar chat, I get: "Failed to deserialize the JSON body into the target type: messages[1].role: unknown variant system, expected user or assistant"
The terminal claude command works fine with the same subscription account.
What Should Happen?
The sidebar chat panel should send messages and receive responses normally.
Error Messages/Logs
API Error: 400 Failed to deserialize the JSON body into the target type: messages[1].role: unknown variant `system`, expected `user` or `assistant` at line 1 column 697
Steps to Reproduce
- Install Claude Code VS Code extension (latest version)
- Login with Claude.ai subscription via OAuth
- Open the sidebar chat panel
- Type any message (e.g. "你好") and press Enter
- Error appears immediately: API Error 400 messages[1].role unknown variant system
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.143
Platform
Other
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗