diff --git a/src/auto-reply/reply/commands-core.ts b/src/auto-reply/reply/commands-core.ts index abbeacf3fab..6f173a11145 100644 --- a/src/auto-reply/reply/commands-core.ts +++ b/src/auto-reply/reply/commands-core.ts @@ -235,8 +235,10 @@ export async function handleCommands(params: HandleCommandsParams): Promise 0 ? params.command.ownerList : undefined, + }).then((learnResult) => { + if (learnResult.ok) { + logVerbose(`Background pre-reset learning completed for session ${targetSessionKey}`); + } else { + logVerbose( + `Background pre-reset learning failed for session ${targetSessionKey}: ${learnResult.message ?? "unknown error"}`, + ); + } }); - if (learnResult.ok) { - logVerbose(`Pre-reset learning completed for session ${targetSessionKey}`); - } else { - logVerbose( - `Pre-reset learning failed for session ${targetSessionKey}: ${learnResult.message ?? "unknown error"}`, - ); - } } if (boundAcpKey) { const resetResult = await resetAcpSessionInPlace({ diff --git a/src/auto-reply/reply/commands-learn.ts b/src/auto-reply/reply/commands-learn.ts index 3c4ce50b632..7c10ca2e0c9 100644 --- a/src/auto-reply/reply/commands-learn.ts +++ b/src/auto-reply/reply/commands-learn.ts @@ -8,12 +8,14 @@ import type { ThinkLevel } from "./directives.js"; const LEARN_SYSTEM_PROMPT = [ "Learning turn.", - "Analyze the session history and remember important insights.", + "Analyze the session history and remember important insights in the specific way the user requests.", ].join(" "); const LEARN_DEFAULT_PROMPT = [ "Learning turn.", - "What important insights, lessons, or information should be remembered from this session?", + "Analyze the session history and remember important insights in the specific way the user requests.", + "Focus on: problems identified, solutions discovered, methods that worked, patterns noticed, and any valuable context.", + "IMPORTANT: Remember ONLY what is truly useful and worth retaining - filter out noise.", ].join(" "); async function resolveSessionFileWithResetFallback(sessionFile: string): Promise {