Skip to content

fix: {file:...} references weren't being parsed correctly in some cases - #1499

Merged
adamdotdevin merged 1 commit into
anomalyco:devfrom
rekram1-node:fix-file-referencess
Aug 1, 2025
Merged

adamdotdevin merged 1 commit into
anomalyco:devfrom
rekram1-node:fix-file-referencess

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Fixes: #1440

This change allows configs like (before only the mode reference would work):

{
  "$schema": "https://opencode.ai/config.json",
  "autoupdate": false,
  "mode": {
    "brainstorm": {
      "temperature": 0.7,
      "prompt": "{file:./prompts/creative.txt}"
    }
  },
  "mcp": {
    // ...
    "github": {
      "enabled": true,
      "headers": {
        "Authorization": "Bearer {file:/home/muni/.config/sops-nix/secrets/github_pat}"
      },
      "type": "remote",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    // ...
  }
}

The other thing I made it so we don't do replaces for comments, because I may delete a file or something and we don't wanna error out if we fail to find that file since it is commented out

@adamdotdevin
adamdotdevin merged commit 90d1698 into anomalyco:dev Aug 1, 2025
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file substitution in configuration results in "invalid JSON"

2 participants