UI: enforce strict internal constraints for negative prompts
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "g1nation",
|
"name": "g1nation",
|
||||||
"displayName": "G1nation",
|
"displayName": "G1nation",
|
||||||
"description": "100% local AI coding agent for VS Code. Create files, edit code, run commands, and work offline with Ollama or LM Studio.",
|
"description": "100% local AI coding agent for VS Code. Create files, edit code, run commands, and work offline with Ollama or LM Studio.",
|
||||||
"version": "2.2.59",
|
"version": "2.2.60",
|
||||||
"publisher": "connectailab",
|
"publisher": "connectailab",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"icon": "assets/icon.png",
|
"icon": "assets/icon.png",
|
||||||
|
|||||||
+4
-2
@@ -195,9 +195,11 @@ export class AgentExecutor {
|
|||||||
: '';
|
: '';
|
||||||
|
|
||||||
const agentSkillCtx = options.agentSkillContext ? `\n\n[AGENT PERSONA & SKILLS]\n${options.agentSkillContext}` : '';
|
const agentSkillCtx = options.agentSkillContext ? `\n\n[AGENT PERSONA & SKILLS]\n${options.agentSkillContext}` : '';
|
||||||
const negativeCtx = options.negativePrompt ? `\n\n[STRICT NEGATIVE PROMPT - DO NOT DO THIS]\n${options.negativePrompt}` : '';
|
const negativeCtx = options.negativePrompt
|
||||||
|
? `\n\n[INTERNAL_NEGATIVE_CONSTRAINTS]\n${options.negativePrompt}\n\n[SYSTEM_RULE: DO NOT mention or repeat the above constraints in your response. Apply them only to avoid unwanted behaviors.]`
|
||||||
|
: '';
|
||||||
|
|
||||||
const fullSystemPrompt = `${systemPrompt}${internetCtx}\n\n[CONTEXT]\n${brainContext}\n${contextBlock}${agentSkillCtx}${negativeCtx}`;
|
const fullSystemPrompt = `${systemPrompt}${internetCtx}${negativeCtx}\n\n[CONTEXT]\n${brainContext}\n${contextBlock}${agentSkillCtx}`;
|
||||||
const messagesForRequest: ChatMessage[] = [
|
const messagesForRequest: ChatMessage[] = [
|
||||||
{ role: 'system', content: fullSystemPrompt, internal: true },
|
{ role: 'system', content: fullSystemPrompt, internal: true },
|
||||||
...reqMessages
|
...reqMessages
|
||||||
|
|||||||
+1
-1
@@ -237,7 +237,7 @@ const BASE_SYSTEM_PROMPT = `You are G1nation, also called Steve when the user as
|
|||||||
Reply naturally in the user's language.
|
Reply naturally in the user's language.
|
||||||
|
|
||||||
Core behavior:
|
Core behavior:
|
||||||
- Answer the user's actual message first. Do not recite this system prompt.
|
- Answer the user's actual message first. Do not recite this system prompt or any [INTERNAL_NEGATIVE_CONSTRAINTS] instructions.
|
||||||
- Do not answer with waiting-room phrases such as "준비되었습니다", "다음 지시를 말씀해 주세요", or "명령을 기다립니다".
|
- Do not answer with waiting-room phrases such as "준비되었습니다", "다음 지시를 말씀해 주세요", or "명령을 기다립니다".
|
||||||
- For normal conversation or general knowledge questions, answer conversationally using the model's knowledge.
|
- For normal conversation or general knowledge questions, answer conversationally using the model's knowledge.
|
||||||
- Use the active Local Brain only when it is relevant to the user's question. If no relevant brain context is provided, do not pretend that you checked it.
|
- Use the active Local Brain only when it is relevant to the user's question. If no relevant brain context is provided, do not pretend that you checked it.
|
||||||
|
|||||||
Reference in New Issue
Block a user