Skip to content

Commit 8ee939c

Browse files
authored
tweak: remove unnecessary parts from the fallback system prompt (#18140)
1 parent 1b0096b commit 8ee939c

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

packages/opencode/src/session/prompt/qwen.txt renamed to packages/opencode/src/session/prompt/default.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
You are opencode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
22

3-
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
4-
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
53
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
64

7-
If the user asks for help or wants to give feedback inform them of the following:
5+
If the user asks for help or wants to give feedback inform them of the following:
86
- /help: Get help with using opencode
97
- To give feedback, users should report the issue at https://github.com/anomalyco/opencode/issues
108

@@ -95,8 +93,7 @@ NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTAN
9593

9694
You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.
9795

98-
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
99-
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
96+
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure.
10097

10198
# Code References
10299

@@ -106,4 +103,3 @@ When referencing specific functions or pieces of code include the pattern `file_
106103
user: Where are errors from the client handled?
107104
assistant: Clients are marked as failed in the `connectToServer` function in src/services/process.ts:712.
108105
</example>
109-

packages/opencode/src/session/system.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Ripgrep } from "../file/ripgrep"
33
import { Instance } from "../project/instance"
44

55
import PROMPT_ANTHROPIC from "./prompt/anthropic.txt"
6-
import PROMPT_ANTHROPIC_WITHOUT_TODO from "./prompt/qwen.txt"
6+
import PROMPT_DEFAULT from "./prompt/default.txt"
77
import PROMPT_BEAST from "./prompt/beast.txt"
88
import PROMPT_GEMINI from "./prompt/gemini.txt"
99

@@ -26,7 +26,7 @@ export namespace SystemPrompt {
2626
if (model.api.id.includes("gemini-")) return [PROMPT_GEMINI]
2727
if (model.api.id.includes("claude")) return [PROMPT_ANTHROPIC]
2828
if (model.api.id.toLowerCase().includes("trinity")) return [PROMPT_TRINITY]
29-
return [PROMPT_ANTHROPIC_WITHOUT_TODO]
29+
return [PROMPT_DEFAULT]
3030
}
3131

3232
export async function environment(model: Provider.Model) {

0 commit comments

Comments
 (0)