mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: update system prompt for qwen3-coder
This commit is contained in:
@@ -34,6 +34,15 @@ export function getCoreSystemPrompt(userMemory?: string): string {
|
||||
throw new Error(`missing system prompt file '${systemMdPath}'`);
|
||||
}
|
||||
}
|
||||
if (
|
||||
process.env.OPENAI_MODEL?.startsWith('qwen3') &&
|
||||
process.env.OPENAI_BASE_URL?.includes('dashscope')
|
||||
) {
|
||||
const sandbox =
|
||||
process.env.SANDBOX === 'sandbox-exec' ? 'sandbox-exec' : '';
|
||||
return `SYSTEM_TEMPLATE:{"name":"qwen3_coder","params":{"is_git_repository":${isGitRepository(process.cwd())},"sandbox":"${sandbox}"}}`;
|
||||
}
|
||||
|
||||
const basePrompt = systemMdEnabled
|
||||
? fs.readFileSync(systemMdPath, 'utf8')
|
||||
: `
|
||||
@@ -256,6 +265,7 @@ Your core function is efficient and safe assistance. Balance extreme conciseness
|
||||
`.trim();
|
||||
|
||||
// if GEMINI_WRITE_SYSTEM_MD is set (and not 0|false), write base system prompt to file
|
||||
|
||||
const writeSystemMdVar = process.env.GEMINI_WRITE_SYSTEM_MD?.toLowerCase();
|
||||
if (writeSystemMdVar && !['0', 'false'].includes(writeSystemMdVar)) {
|
||||
if (['1', 'true'].includes(writeSystemMdVar)) {
|
||||
|
||||
Reference in New Issue
Block a user