fix(claude): support Windows Desktop sessions via APPDATA (#615)

* fix(claude): use APPDATA for Windows Desktop sessions

* test(claude): harden withPlatform mock against cross-file leak

The process.platform mock omitted configurable:true and never restored
the value when the property had no own descriptor, leaving win32 mocked
for later tests on the same Vitest worker. Add configurable + an else
branch that deletes the override to expose the real inherited value.

---------

Co-authored-by: AgentSeal <hello@agentseal.org>
This commit is contained in:
ozymandiashh 2026-07-16 12:13:11 +03:00 committed by GitHub
parent 4ef32c27cb
commit e2d006be9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 50 additions and 3 deletions

View file

@ -105,7 +105,10 @@ export function getDesktopSessionsDir(): string {
const override = process.env['CODEBURN_DESKTOP_SESSIONS_DIR']
if (override) return override
if (process.platform === 'darwin') return join(homedir(), 'Library', 'Application Support', 'Claude', 'local-agent-mode-sessions')
if (process.platform === 'win32') return join(homedir(), 'AppData', 'Roaming', 'Claude', 'local-agent-mode-sessions')
if (process.platform === 'win32') {
const appData = process.env['APPDATA']?.trim()
return join(appData || join(homedir(), 'AppData', 'Roaming'), 'Claude', 'local-agent-mode-sessions')
}
return join(homedir(), '.config', 'Claude', 'local-agent-mode-sessions')
}