[PR #10328] fix: retry webfetch with simple UA on 403 #13405

Closed
opened 2026-02-16 18:18:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10328

State: closed
Merged: Yes


What does this PR do?

Closes #10322

Some sites (e.g. minecraft.wiki) use Cloudflare's strict bot protection. Current Chrome User-Agent gets blocked because the TLS fingerprint doesn't match a real browser.

Fix: if we get a 403 with cf-mitigated: challenge, retry with an honest opencode User-Agent. Cloudflare lets it through.

How did you verify your code works?

Prompt:

WebFetch: https://minecraft.wiki/w/Java_Edition_protocol/FAQ

Before: Error: Request failed with status code: 403
After: Returns page content

image
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10328 **State:** closed **Merged:** Yes --- ### What does this PR do? Closes #10322 Some sites (e.g. minecraft.wiki) use Cloudflare's strict bot protection. Current Chrome User-Agent gets blocked because the TLS fingerprint doesn't match a real browser. Fix: if we get a 403 with cf-mitigated: challenge, retry with an honest opencode User-Agent. Cloudflare lets it through. ### How did you verify your code works? Prompt: ``` WebFetch: https://minecraft.wiki/w/Java_Edition_protocol/FAQ ``` Before: `Error: Request failed with status code: 403` After: Returns page content <img width="1471" height="418" alt="image" src="https://github.com/user-attachments/assets/7de62eeb-98da-4bff-9d0c-fb036d1d7a6f" />
yindo added the pull-request label 2026-02-16 18:18:16 -05:00
yindo closed this issue 2026-02-16 18:18:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13405