anomalyco / anomalyco/opencode
webfetch loops through Google OAuth and times out on developer.android.com
@jlongster is already working on this.
Since Aug 30, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
webfetch times out on public developer.android.com pages that are immediately reachable with curl. The browser-like Chrome UA used by packages/opencode/src/tool/webfetch.ts makes Android DevSite start a silent Google OAuth flow. Because webfetch has no browser cookies, the request loops through oauth2authorize -> accounts.google.com -> oauth2callback?error=interaction_required -> the original page until the fetch redirect limit/timeout is reached.
Changing only the UA to opencode returns HTTP 200. The OpenCode-User/1.0 UA fix merged in #43330 appears to cover packages/core/src/tool/plugin/webfetch.ts, but the currently shipped packages/opencode/src/tool/webfetch.ts and current dev branch still use Chrome 143.
Related stale issues: #11299 and #14453. Open PR #39757 also changes both implementations, but includes broader robots.txt behavior.
Plugins
None relevant
OpenCode version
1.18.23; confirmed the same Chrome UA remains in v1.18.25 and current dev source
Steps to reproduce
- Run webfetch for
https://developer.android.com/guide/navigation/navigation-3orhttps://developer.android.com/robots.txt. - Observe
Request timed out. - Fetch the same URL with curl and observe HTTP 200.
- Reproduce with Bun/Node
fetchusing the Chrome 143 UA frompackages/opencode/src/tool/webfetch.ts; Node eventually reportsredirect count exceeded. - Repeat using
User-Agent: opencode; observe HTTP 200.
Expected: public Android Developers pages should return normally. At minimum, both webfetch implementations should use the transparent OpenCode-User/1.0 identity from #43330 rather than the fake browser UA. Redirect-loop detection would also produce a clearer error than a timeout.
Screenshot and/or share link
N/A
Operating System
Debian GNU/Linux 13
Terminal
OpenCode web service
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.