fix: isolate scratchpad session working directories

Give each scratchpad session its own working directory, migrate existing scratchpad sessions on workspace load, and route sidecar turns through the session-specific cwd. Add regression coverage for create, duplicate, delete, and migration flows, and document the new persistence model.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-28 14:31:39 +01:00
co-authored by Copilot
parent fa5774cbc0
commit 147b437e36
9 changed files with 366 additions and 18 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ import { createWorkspaceSeed, type WorkspaceState } from '@shared/domain/workspa
const TIMESTAMP = '2026-03-25T00:00:00.000Z';
const SCRATCHPAD_PATH = 'C:\\workspace\\personal\\repositories\\aryx\\scratchpad';
const SCRATCHPAD_SESSION_PATH = `${SCRATCHPAD_PATH}\\session-scratchpad`;
mock.module('electron', () => {
const electronMock = {
@@ -60,6 +61,7 @@ function createWorkspaceFixture(): {
createdAt: TIMESTAMP,
updatedAt: TIMESTAMP,
status: 'idle',
cwd: SCRATCHPAD_SESSION_PATH,
messages: [],
runs: [],
};
@@ -186,7 +188,7 @@ describe('AryxAppService scratchpad tooling support', () => {
expect(command).toMatchObject({
sessionId: session.id,
projectPath: SCRATCHPAD_PATH,
projectPath: SCRATCHPAD_SESSION_PATH,
workspaceKind: 'scratchpad',
tooling: {
mcpServers: [