fix(opencode): add a flag to skip the config dependency install

Merged
RE
6h ago
+35-1

Why

At each start, bcode installs @opencode-ai/plugin@<bcode version> in each config directory. A release build asks for a version that does not exist on npm, such as 0.1.21-bu4-family.1. So the install always fails, but first it downloads the full version list of the package: 27.7 MB, 3.4 MB compressed.

In the cloud, each agent sandbox starts with an empty cache and has 2 config directories. A production flow log (2026-12-03, 34 minutes) shows 2,412 of these downloads, 8.5 GB. That is about 13% of the NAT gateway traffic, about 600 USD per month.

What

OPENCODE_DISABLE_CONFIG_INSTALL=1 skips this install of the server config. Without the variable, nothing changes. The separate install of the TUI config stays, because bcode serve does not load it.

The cloud worker sets the variable after it uses a bcode release with this change.

Proof

  • New test: the install runs without the variable and does not run in any config directory with it. The test fails when the guard is removed.
  • Real start from source with an empty home: 117 MB npm cache without the variable, no npm cache and no node_modules with it.
  • bun run typecheck passes in packages/opencode and packages/core.

šŸ¤– Generated with Claude Code