There was an error handling the response from Claude 4 Sonnet.
Before submitting your bug report
- [x] I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- [ ] I'm not able to find a related conversation on GitHub discussions that reports the same bug
- [ ] I'm not able to find an open issue that reports the same bug
- [ ] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS:windows
- Continue version:1.2.11
- IDE version:1.107.1
- Model:
- config:
OR link to agent in Continue hub:
Description
getting issue while using claude Sonnet 4 Error handling model response There was an error handling the response from Claude 4 Sonnet. {"type":"invalid_request_error","message":"prompt is too long: 201248 tokens > 200000 maximum"}
To reproduce
No response
Log output
Related issues:
- #9231 - Context length calculation incorrect for Anthropic Claude models (shows 130k tokens at 70% when actually 200k)
- #8454 - Error Handling model response (input length and max_tokens exceed context limit: 143653 + 64000 > 200000)
- #6136 - Error handling model response (input length and max_tokens exceed context limit: 198214 + 8192 > 200000)
- #3342 - AWS Bedrock Always Returns MaxTokens Error
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
@prikshitSharma I believe this was addressed as we added a 30% counting buffer for anthropic models around the time this was opened.