anomalyco / anomalyco/opencode
V2 web UI returns 404 for empty assets, breaking service worker installation
@Hona is already working on this.
Since Sep 5, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The V2 web UI service worker fails installation while precaching an empty JavaScript asset:
bad-precaching-response :: [{"url":"https://<server>/_assets/__vite-browser-external-2447137e-BvRk9kiK.js","status":404}]
The worker transitions to redundant. Its precache entry has the SHA-256 integrity of an empty file. In packages/cli/src/services/web-ui.ts, serveUI uses if (!file) after looking up the asset; valid empty text assets therefore return 404 instead of an empty 200 response.
Plugins
Not applicable to static asset serving.
OpenCode version
0.0.0-beta-19151; the falsy asset check is also present on v2 at 7ad705225e52160e9956fb727ac7c0801b3ac979.
Steps to reproduce
- Open the V2 served web UI in a fresh Chromium profile.
- Inspect the service worker registration and installation errors (or register
/sw.jsmanually). - Observe the failed precache request above and the worker becoming
redundant. - A minimal server regression fixture is an
AssetMapcontaining"_assets/empty.js": "": GET and HEAD currently return 404, though the asset exists.
Screenshot and/or share link
The diagnostic above is from Chromium's ServiceWorker.workerErrorReported event. No session data is needed to reproduce.
Operating System
Arch Linux, Chromium.
Terminal
Not applicable.
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.