fix: use dedicated lane for background learning to avoid blocking
This commit is contained in:
parent
f469c7a439
commit
b1aff9fe8a
@ -235,7 +235,7 @@ export async function handleCommands(params: HandleCommandsParams): Promise<Comm
|
||||
}
|
||||
|
||||
// Trigger learning before reset/new commands (after ACP target resolution)
|
||||
// Run in background - don't await, so reset happens immediately
|
||||
// Run in background with dedicated lane to avoid blocking user interactions
|
||||
if (targetSessionEntry?.sessionId && targetSessionEntry.sessionFile) {
|
||||
const thinkLevel = params.resolvedThinkLevel ?? (await params.resolveDefaultThinkingLevel());
|
||||
runLearnForSession({
|
||||
@ -258,6 +258,7 @@ export async function handleCommands(params: HandleCommandsParams): Promise<Comm
|
||||
"What insights and lessons should be remembered before starting a new session?",
|
||||
senderIsOwner: params.command.senderIsOwner,
|
||||
ownerNumbers: params.command.ownerList.length > 0 ? params.command.ownerList : undefined,
|
||||
lane: "learn",
|
||||
}).then((learnResult) => {
|
||||
if (learnResult.ok) {
|
||||
logVerbose(`Background pre-reset learning completed for session ${targetSessionKey}`);
|
||||
|
||||
@ -79,6 +79,7 @@ export async function runLearnForSession(params: {
|
||||
customFocus?: string;
|
||||
senderIsOwner: boolean;
|
||||
ownerNumbers?: string[];
|
||||
lane?: string;
|
||||
}): Promise<{ ok: boolean; message?: string }> {
|
||||
const prompt = params.customFocus
|
||||
? `Focus area: ${params.customFocus}. ${LEARN_DEFAULT_PROMPT}`
|
||||
@ -114,6 +115,7 @@ export async function runLearnForSession(params: {
|
||||
extraSystemPrompt: LEARN_SYSTEM_PROMPT,
|
||||
trigger: "memory",
|
||||
timeoutMs: 5 * 60 * 1000, // 5 minutes
|
||||
lane: params.lane,
|
||||
senderIsOwner: params.senderIsOwner,
|
||||
ownerNumbers: params.ownerNumbers,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user