[PR #1499] [MERGED] fix: {file:...} references weren't being parsed correctly in some cases #9950

Closed
opened 2026-02-16 18:14:26 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1499
Author: @rekram1-node
Created: 8/1/2025
Status: Merged
Merged: 8/1/2025
Merged by: @adamdotdevin

Base: devHead: fix-file-referencess


📝 Commits (1)

  • 07c52e6 fix: {file:...} references weren't being parsed correctly in some cases

📊 Changes

1 file changed (+11 additions, -4 deletions)

View changed files

📝 packages/opencode/src/config/config.ts (+11 -4)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1499 **Author:** [@rekram1-node](https://github.com/rekram1-node) **Created:** 8/1/2025 **Status:** ✅ Merged **Merged:** 8/1/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `fix-file-referencess` --- ### 📝 Commits (1) - [`07c52e6`](https://github.com/anomalyco/opencode/commit/07c52e6534cca433f5c403aecd2b67815da5ee8d) fix: {file:...} references weren't being parsed correctly in some cases ### 📊 Changes **1 file changed** (+11 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/config/config.ts` (+11 -4) </details> ### 📄 Description Fixes: #1440 This change allows configs like (before only the mode reference would work): ```json { "$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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:26 -05:00
yindo closed this issue 2026-02-16 18:14:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9950