From e815c3c10e943dd5d80f9d5cdcf03c303bb81c10 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Thu, 11 Dec 2025 14:03:14 +0800 Subject: [PATCH] fix(session-manager): support archived parameter in getSessionBase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ccw/src/tools/session-manager.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ccw/src/tools/session-manager.js b/ccw/src/tools/session-manager.js index 4c4ebf99..6c2ace43 100644 --- a/ccw/src/tools/session-manager.js +++ b/ccw/src/tools/session-manager.js @@ -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); } /**