Skip to content

Conversation

@kdcokenny
Copy link
Contributor

Summary

When config is provided via the OPENCODE_CONFIG_CONTENT environment variable, token substitution ({env:VAR}, {file:path}) was not being applied because the inline JSON was merged directly via JSON.parse() instead of going through the load() pipeline that handles substitution.

This change routes inline config content through load() so that all token references are resolved consistently with file-based configs.

Changes

  • packages/opencode/src/config/config.ts: Parse OPENCODE_CONFIG_CONTENT with JSONC, inject $schema if missing, and pass through load() for token substitution
  • packages/opencode/test/config/config.test.ts: Add 6 tests covering {env:VAR} substitution, {file:path} substitution, missing file errors, precedence over project config, malformed JSON rejection, and no disk artifact creation

Test command

bun test packages/opencode/test/config/config.test.ts

Fixes #13219

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@kdcokenny kdcokenny marked this pull request as ready for review February 12, 2026 00:34
@kdcokenny
Copy link
Contributor Author

kdcokenny commented Feb 12, 2026

Taken over by #13384

@kdcokenny kdcokenny closed this Feb 12, 2026
@kdcokenny kdcokenny deleted the fix/opencode-config-content-substitution branch February 12, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPENCODE_CONFIG_CONTENT bypasses {env:} and {file:} token substitution

1 participant