refactor: Invert AI agent verbose mode condition and strengthen silence instructions for tool calls.

This commit is contained in:
jxxghp
2026-03-27 22:01:08 +08:00
parent 60e1e3c173
commit a8ecdc8206

View File

@@ -74,10 +74,14 @@ class PromptManager:
# 啰嗦模式
verbose_spec = ""
if settings.AI_AGENT_VERBOSE:
verbose_spec = "\n\n[Important Instruction] If you need to call a tool, DO NOT output any conversational "
"text or explanations before calling the tool. Call the tool directly without transitional "
"phrases like 'Let me check', 'I will look this up', etc."
if not settings.AI_AGENT_VERBOSE:
verbose_spec = (
"\n\n[Important Instruction] STRICTLY ENFORCED: DO NOT output any conversational "
"text, thinking processes, or explanations before or during tool calls. Call tools "
"directly without any transitional phrases. "
"You MUST remain completely silent until the task is completely finished. "
"DO NOT output any content whatsoever until your final summary reply."
)
# 始终替换占位符,避免后续 .format() 时因残留花括号报 KeyError
base_prompt = base_prompt.format(