Skip to content

bug(config): pluginAutoInstall config has no effect #27923

@ranxianglei

Description

@ranxianglei

Bug Description

The pluginAutoInstall config field exists in the schema but has no effect. Users can set pluginAutoInstall: false in their config file, but plugins still auto-install because the config value is never checked by any code.

Only the undocumented OPENCODE_DISABLE_PLUGIN_INSTALL=true environment variable actually disables auto-install, but there's no way to set this from the config file.

Steps to Reproduce

  1. Add "pluginAutoInstall": false to opencode.json
  2. Start opencode
  3. Observe that plugins are still auto-installed (check ~/.cache/opencode/packages/)

Root Cause

  • npm.ts: add() and install() never check any disable flag
  • config.ts: pluginAutoInstall schema field is not wired to set the env var
  • flag.ts: No OPENCODE_DISABLE_PLUGIN_INSTALL flag defined as a runtime getter

Expected Behavior

Setting pluginAutoInstall: false in config should prevent automatic plugin installation, equivalent to setting OPENCODE_DISABLE_PLUGIN_INSTALL=true.

Impact

This caused a critical issue in our deployment: opencode auto-installed an npm package that overwrote our patched fork plugin, destroying session compression state and losing data.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions