Skip to content

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

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

fix: {file:...} references weren't being parsed correctly in some cases#1499
adamdotdevin merged 1 commit intoanomalyco:devfrom
rekram1-node:fix-file-referencess

Conversation

@rekram1-node
Copy link
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

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