anomalyco / anomalyco/opencode

V2 web UI returns 404 for empty assets, breaking service worker installation

Open
#47,467 0 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Sep 5, 2026.

2.0
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
  1. Open the V2 served web UI in a fresh Chromium profile.
  2. Inspect the service worker registration and installation errors (or register /sw.js manually).
  3. Observe the failed precache request above and the worker becoming redundant.
  4. A minimal server regression fixture is an AssetMap containing "_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.