Skip to content

Commit 26f9a2e

Browse files
committed
fix(core): mandate backticks for file references in system prompt
- update system prompt to explicitly require backticks around file:// URIs - add examples distinguishing correct backticked format from incorrect ones - ensures file references are consistently formatted for UI and parsing
1 parent e93b47c commit 26f9a2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/opencode/core.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,13 @@ M.send_message = Promise.async(function(prompt, opts)
170170
params.system = [[
171171
# Code References
172172
173-
**CRITICAL: Always use the file:// URI scheme when referencing files in responses.**
173+
**CRITICAL: Always use the file:// URI scheme when referencing files in responses AND wrap them in backticks.**
174174
175175
Format: `file://path/to/file.lua`, `file://path/to/file.lua:42`, or `file://path/to/file.lua:42-50`
176176
177177
Examples:
178-
- CORRECT: "The error is in file://src/services/process.ts:712"
178+
- CORRECT: "The error is in `file://src/services/process.ts:712`"
179+
- INCORRECT: "The error is in file://src/services/process.ts:712"
179180
- INCORRECT: "The error is in src/services/process.ts:712"
180181
181182
This matches the file:// URI format that the reference picker already parses from your responses, enabling automatic navigation.

0 commit comments

Comments
 (0)