Description
Variable substitution in configurations crash if the value contains character sequences that are interpreted by String.replace as special replacement patterns. See reproduction steps:
$ cat test-file
$`
$ cat opencode.json
[...]
"agent": {
"test-agent": {
"mode": "primary",
"prompt": "{file:./test-file}"
}
}
[...]
$ opencode
[...]
--- Errors ---
UnexpectedEndOfString at line 51, column 17
Line 51: "prompt": "{
^
CommaExpected at line 53, column 3
Line 53: "$schema": "https://opencode.ai/config.json",
^
CloseBraceExpected at line 105, column 1
CloseBraceExpected at line 105, column 1
--- End ---
Plugins
None
OpenCode version
1.1.41 (and also latest dev branch at 3408f1a)
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Linux
Terminal
Ghostty