Skip to content

core: restore non-experimental environment variable compatibility in v2 #36990

Description

@opencode-agent

Summary

V2 does not preserve a number of non-experimental environment-variable behaviors supported by V1. Some variables remain declared in packages/core/src/flag/flag.ts but have no active V2 consumer; others disappeared with their V1 subsystem.

This is the umbrella issue for the broader compatibility gap reported narrowly in #36837.

Audited against:

  • V1 / dev: b6478dcebf1da4a559055c702c62b9294c41afdb
  • V2: ba1f3d3d32690879fbed156d53570b8652e254ed

Completely ignored in V2

Configuration and permissions

  • OPENCODE_CONFIG — explicit config-file override
  • OPENCODE_CONFIG_CONTENT — inline config injection
  • OPENCODE_PERMISSION — JSON permission override
  • OPENCODE_DISABLE_AUTOCOMPACT — force-disable automatic compaction
  • OPENCODE_DISABLE_PRUNE — force-disable compaction pruning
  • OPENCODE_FAKE_VCS — override detected VCS

Sharing and authentication

  • OPENCODE_AUTO_SHARE — force automatic sharing
  • OPENCODE_DISABLE_SHARE — globally disable sharing
  • OPENCODE_AUTH_CONTENT — in-memory auth JSON override

Plugins, skills, and compatibility discovery

  • OPENCODE_PURE — suppress external plugins/runtime integrations
  • OPENCODE_DISABLE_DEFAULT_PLUGINS — suppress built-in plugins
  • OPENCODE_DISABLE_EXTERNAL_SKILLS — suppress external skill discovery
  • OPENCODE_DISABLE_CLAUDE_CODE — suppress Claude compatibility discovery
  • OPENCODE_DISABLE_CLAUDE_CODE_PROMPT — suppress Claude prompt discovery
  • OPENCODE_DISABLE_CLAUDE_CODE_SKILLS — suppress Claude skill discovery
  • OPENCODE_PLUGIN_META_FILE — override plugin metadata path

Other runtime controls

  • OPENCODE_DISABLE_LSP_DOWNLOAD — prevent language-server installation
  • OPENCODE_ENABLE_QUESTION_TOOL — control question-tool availability
  • OPENCODE_DISABLE_EMBEDDED_WEB_UI — suppress embedded UI routes
  • OPENCODE_AUTO_HEAP_SNAPSHOT — enable automatic heap snapshots
  • OPENCODE_ALWAYS_NOTIFY_UPDATE — force update notifications

Partially handled or changed

  • OPENCODE_DISABLE_PROJECT_CONFIG only suppresses project AGENTS.md. V2 still loads project opencode.json(c) and project .opencode, .claude, and .agents directories. See core: OPENCODE_DISABLE_PROJECT_CONFIG is ignored in v2 #36837.
  • OPENCODE_CONFIG_DIR changes the global config root in V2 instead of acting as the additional explicit config source it was in V1. Confirm and restore the intended compatibility semantics.
  • OPENCODE_SERVER_PASSWORD is still accepted, but the V2 CLI prefers OPENCODE_PASSWORD and managed-server credential propagation differs from V1.
  • OPENCODE_SERVER_USERNAME only affects manually configured server authentication, not the new managed-service credential path.

Intentional change

OPENCODE_TUI_CONFIG is not included in the compatibility checklist. V2 intentionally moved to one global cli.json and does not support arbitrary or project-local TUI configuration.

Expected behavior

Per the V1-to-V2 migration contract, non-API V1 functionality is intended to remain compatible. For every item above, either:

  1. restore the V1 behavior in V2 and add coverage, or
  2. explicitly decide that the behavior is obsolete, remove stale declarations/documentation, and document the migration path.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

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