Skip to content

Commit 9885d95

Browse files
committed
feat(config): update system prompt for file referencing in responses
- remove old system prompt setting in configuration - replace it with a hardcoded prompt including URI format examples - modifies behavior to improve navigation and tooling integration
1 parent 14ddd5c commit 9885d95

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lua/opencode/config.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ M.defaults = {
200200
on_done_thinking = nil,
201201
on_permission_requested = nil,
202202
},
203-
-- Additional system prompt, used to customize assistant behavior (e.g., file reference formatting)
204-
system_prompt = 'When referencing files in your responses, always use the file:// URI scheme (e.g., file://path/to/file.lua or file://path/to/file.lua:42 for a specific line). This helps with navigation and tooling integration.',
205203
}
206204

207205
M.values = vim.deepcopy(M.defaults)

lua/opencode/core.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ M.send_message = Promise.async(function(prompt, opts)
167167
state.current_mode = opts.agent
168168
end
169169

170-
-- Add system prompt if configured
171-
if config.system_prompt and config.system_prompt ~= '' then
172-
params.system = config.system_prompt
173-
end
170+
params.system =
171+
'When referencing files in your responses, always use the file:// URI scheme (e.g., file://path/to/file.lua, file://path/to/file.lua:42 for a specific line, or file://path/to/file.lua:42-50 for a range). This helps with navigation and tooling integration.'
174172

175173
params.parts = context.format_message(prompt, opts.context)
176174
M.before_run(opts)

0 commit comments

Comments
 (0)