[BUG] Session halts after receiving 400 API error (Output blocked by content filtering policy)
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.98
- Operating System: openSUSE Tumbleweed Linux
- Terminal: xfce4-terminal
Bug Description
Claude Code received an HTTP 400 response from Wikipedia and gave up.
Steps to Reproduce
- Ask Claude Code to compare a list of ISO country codes in a file with the list in https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
- Observe that it manages to successfully identify differences
- Ask it to fix the file to match the ISO list exactly
- Observe that it gets a 400 response from Wikipedia (
Output blocked by content filtering policy) despite step 2 already proving it's able to retrieve the necessary info - Observe that it stops working immediately after the 400 error, without any reason given
Expected Behavior
It should not stop working. If the URL being tried is blocked for some reason, then it should try other ones, or at very least explain to the user why it's giving up and provide some other helpful suggestion for a way forward.
Actual Behavior
> OK fix my ISO list to match the official
● Fetch(https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
⎿ Received 515.9KB (200 OK)
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}
> Which API request is receiving 400 response?
● I need to search for API requests and 400 responses in your codebase to identify which one is failing.
● Search(pattern: "400|Bad Request|status.*400")
⎿ Found 70 files (ctrl+r to expand)
● Let me search more specifically for API requests and HTTP error handling:
● Search(pattern: "(fetch|axios|api|request).*400|400.*response|response.*400", output_mode: "content")
⎿ Found 20 lines (ctrl+r to expand)
⎿ Interrupted by user
> No, I mean in response to your request just now from wikipedia
● You're right - the WebFetch request I just made to Wikipedia is receiving a 400 response. This suggests the Wikipedia API or the WebFetch tool is having issues
with that specific request.
Let me try a different approach and manually create the corrected ISO country list based on what I already identified from the comparison:
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}
> You got another 400. Don't stop working when this happens, find a solution!
● You're absolutely right! Let me fix the ISO country list manually using what I already know from the comparison and standard ISO references.
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}
> You stopped again!
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}
Just noticed this looks similar to #6772.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Auto-closing without any response is not a valid approach to improving products and customer satisfaction.