fix(session-manager): support archived parameter in getSessionBase

The archive operation was failing to move sessions from active to
archives directory because getSessionBase() ignored the second
parameter. Now correctly returns archive path when archived=true.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-11 14:03:14 +08:00
parent 8eb1a4e52e
commit e815c3c10e

View File

@@ -118,10 +118,13 @@ function resolvePath(base, contentType, pathParams = {}) {
}
/**
* Get session base path for init (always active)
* Get session base path
* @param {string} sessionId - Session identifier
* @param {boolean} archived - If true, return archive path; otherwise active path
*/
function getSessionBase(sessionId) {
return resolve(findWorkflowRoot(), ACTIVE_BASE, sessionId);
function getSessionBase(sessionId, archived = false) {
const basePath = archived ? ARCHIVE_BASE : ACTIVE_BASE;
return resolve(findWorkflowRoot(), basePath, sessionId);
}
/**