From 5cf0584068442a88a17cb66fc707a151a3c5606b Mon Sep 17 00:00:00 2001 From: zhixian Date: Mon, 26 Jan 2026 19:40:54 +0900 Subject: [PATCH] fix: use sessionFile from entry for threaded sessions Address Codex review: prefer previousSessionEntry.sessionFile which includes thread suffix for topic sessions, fall back to resolveSessionTranscriptPath for legacy sessions. --- src/auto-reply/reply/get-reply.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/auto-reply/reply/get-reply.ts b/src/auto-reply/reply/get-reply.ts index 36b1beb1f..dd915fcfe 100644 --- a/src/auto-reply/reply/get-reply.ts +++ b/src/auto-reply/reply/get-reply.ts @@ -130,9 +130,13 @@ export async function getReplyFromConfig( // Handle /reset prune - delete session entry and transcript, then return confirmation if (resetTriggered && pruneRequested && previousSessionEntry) { - const transcriptPath = previousSessionEntry.sessionId - ? resolveSessionTranscriptPath(previousSessionEntry.sessionId, agentId) - : undefined; + // Prefer sessionFile from entry (includes thread suffix for topics), + // fall back to resolveSessionTranscriptPath for legacy sessions + const transcriptPath = + previousSessionEntry.sessionFile?.trim() || + (previousSessionEntry.sessionId + ? resolveSessionTranscriptPath(previousSessionEntry.sessionId, agentId) + : undefined); await deleteSessionEntry({ storePath, sessionKey,