anomalyco / anomalyco/opencode

Auto-updater ate 266 GB by reinstalling OpenCode every 10 minutes

Open
#45,087 6 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 25, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

A long-running opencode2 serve --service process filled ~/.npm/_cacache with 266 GB of OpenCode beta packages.

After npm updates the executable, the running server keeps its original compiled version in memory. Its ten-minute update loop still thinks it is outdated, so it installs the same latest version again.

My logs repeat this indefinitely:

update check current=0.0.0-next-16473 latest=0.0.0-beta-17498
updated OpenCode from=0.0.0-next-16473 to=0.0.0-beta-17498 method=npm

# ten minutes later

update check current=0.0.0-next-16473 latest=0.0.0-beta-17498
updated OpenCode from=0.0.0-next-16473 to=0.0.0-beta-17498 method=npm

The service ran unattended for roughly three weeks:

265.97GiB  ~/.npm/_cacache

The current beta source still schedules checks every ten minutes and compares against the immutable OPENCODE_VERSION.

Related to #38567 and #41495, but this happens after successful updates and continues until the disk fills.

Plugins

None required.

OpenCode version

0.0.0-next-16473, repeatedly updating through the beta channel.

Steps to reproduce

Use a disposable environment because this can consume substantial disk space.

root=/var/tmp/opencode-updater-repro
mkdir -p "$root/home" "$root/npm-prefix" "$root/npm-cache"

export HOME="$root/home"
export NPM_CONFIG_PREFIX="$root/npm-prefix"
export NPM_CONFIG_CACHE="$root/npm-cache"
export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"

npm install -g @opencode-ai/cli@0.0.0-beta-18219
opencode2 serve --service

Then:

  1. Let the first automatic update complete.
  2. Confirm the globally installed package is now newer.
  3. Leave the original server running for another ten minutes.
  4. Check the OpenCode and npm logs.
  5. The server installs the same latest package again because its reported current version never changes.
  6. Each cycle adds more packages to the npm cache.
grep -E "update check|updated OpenCode" \
  "$HOME/.local/share/opencode/log/opencode.log"

du -sh "$NPM_CONFIG_CACHE"
Screenshot and/or share link

N/A

Operating System

Fedora Linux 44, kernel 7.1.5-200.fc44.x86_64

Terminal

Ghostty

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.