Skip to content

Conversation

@ariane-emory
Copy link
Contributor

What does this PR do?

Route OPENCODE_CONFIG_CONTENT through load() to enable {env:} and {file:} token substitution. Uses the env var name as the path for clearer error messages instead of a generic placeholder.

Fixes anommalyco#13219

How did you verify your code works?

Manual testing, bun typecheck, bun test.

You may manually test by running commands akin to the following (assuming bash):

echo "matrix" > /tmp/test-secret.txt 
export MODEL="opencode/big-pickle"
OPENCODE_CONFIG_CONTENT='{"$schema":"https://opencode.ai/config.json","theme":"{file:/tmp/test-secret.txt}", "model":"{env:MODEL}"}' bun dev```

Route OPENCODE_CONFIG_CONTENT through load() to enable {env:} and {file:}
token substitution. Uses the env var name as the path for clearer error
messages instead of a generic <inline> placeholder.

Fixes anomalyco#13219
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

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

Potential Duplicate PRs Found

  1. PR fix: token substitution in OPENCODE_CONFIG_CONTENT #13241 - fix: token substitution in OPENCODE_CONFIG_CONTENT

  2. PR fix(config): apply token substitution for OPENCODE_CONFIG_CONTENT #13226 - fix(config): apply token substitution for OPENCODE_CONFIG_CONTENT

Why they might be related: Both PRs directly address the same issue (enabling token substitution in OPENCODE_CONFIG_CONTENT) that your PR #13349 is fixing. They appear to be previous attempts or related fixes for the same underlying problem mentioned in issue #13219.

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.

1 participant