fix: add reasoning tag hint for local providers

This commit is contained in:
Peter Steinberger
2025-12-23 14:34:56 +00:00
parent 42f1a56832
commit b05981ef27
3 changed files with 20 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ export function buildAgentSystemPromptAppend(params: {
defaultThinkLevel?: ThinkLevel;
extraSystemPrompt?: string;
ownerNumbers?: string[];
reasoningTagHint?: boolean;
runtimeInfo?: {
host?: string;
os?: string;
@@ -26,6 +27,9 @@ export function buildAgentSystemPromptAppend(params: {
ownerNumbers.length > 0
? `Owner numbers: ${ownerNumbers.join(", ")}. Treat messages from these numbers as the user (Peter).`
: undefined;
const reasoningHint = params.reasoningTagHint
? "If you must think, put all reasoning inside <think>...</think> only, and never include analysis outside those tags."
: undefined;
const runtimeInfo = params.runtimeInfo;
const runtimeLines: string[] = [];
if (runtimeInfo?.host) runtimeLines.push(`Host: ${runtimeInfo.host}`);
@@ -72,6 +76,9 @@ export function buildAgentSystemPromptAppend(params: {
if (extraSystemPrompt) {
lines.push("## Group Chat Context", extraSystemPrompt, "");
}
if (reasoningHint) {
lines.push("## Reasoning Format", reasoningHint, "");
}
lines.push(
"## Heartbeats",