refactor(session): centralize transcript path option resolution

This commit is contained in:
Peter Steinberger
2026-02-22 12:00:54 +01:00
parent 37f12eb7ee
commit b77e53da67
5 changed files with 58 additions and 14 deletions

View File

@@ -8,6 +8,7 @@ import { hasNonzeroUsage } from "../../agents/usage.js";
import {
resolveAgentIdFromSessionKey,
resolveSessionFilePath,
resolveSessionFilePathOptions,
resolveSessionTranscriptPath,
type SessionEntry,
updateSessionStore,
@@ -324,7 +325,11 @@ export async function runReplyAgent(params: {
defaultRuntime.error(buildLogMessage(nextSessionId));
if (cleanupTranscripts && prevSessionId) {
const transcriptCandidates = new Set<string>();
const resolved = resolveSessionFilePath(prevSessionId, prevEntry, { agentId });
const resolved = resolveSessionFilePath(
prevSessionId,
prevEntry,
resolveSessionFilePathOptions({ agentId, storePath }),
);
if (resolved) {
transcriptCandidates.add(resolved);
}