refactor(code-mode): move ACP session files out of WorkDir/config

Per-run ACP session state is runtime state that accumulates one file per
chat run, not user/app config. Relocate it from WorkDir/config to a
dedicated WorkDir/code-mode/sessions/ so it can be listed, cleaned up, and
managed on its own without crowding config. Drop the now-redundant
codesession- filename prefix (the directory conveys it).
This commit is contained in:
Gagancreates 2026-06-05 14:40:07 +05:30
parent fd434cc52c
commit 0558305cd3

View file

@ -13,8 +13,13 @@ export interface StoredSession {
sessionId: string;
}
// Per-run ACP session state lives in its own directory (not WorkDir/config): it's
// runtime state that accumulates one file per chat run, so it's kept separate from
// user/app config to be listed and cleaned up on its own.
const SESSIONS_DIR = path.join(WorkDir, 'code-mode', 'sessions');
function sessionFile(runId: string): string {
return path.join(WorkDir, 'config', `codesession-${runId}.json`);
return path.join(SESSIONS_DIR, `${runId}.json`);
}
export async function readStoredSession(runId: string): Promise<StoredSession | null> {