{"record":{"id":"c5640513c00317fc","repo":"slopus/happy","slug":"saved-session-path-does-not-exist-launch-cwd","errorCode":null,"errorMessage":"Saved session path does not exist: ${launch.cwd}","messagePattern":"Saved session path does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/happy-cli/src/resume/handleResumeCommand.ts","lineNumber":167,"sourceCode":"        return;\n    }\n\n    let localError: unknown;\n    let reconnectableSession: ReconnectableHappySession | null = null;\n    try {\n        reconnectableSession = await resolveLocalReconnectableSession(parsed.sessionId);\n    } catch (error) {\n        localError = error;\n        if (error instanceof LocalResumeSessionError && error.code === 'ambiguous') {\n            throw error;\n        }\n    }\n\n    if (reconnectableSession) {\n        const launch = buildResumeLaunch(reconnectableSession);\n\n        if (!existsSync(launch.cwd)) {\n            throw new Error(`Saved session path does not exist: ${launch.cwd}`);\n        }\n\n        const exitCode = await spawnResumeChild(launch, buildReconnectEnv(reconnectableSession));\n        if (typeof exitCode === 'number' && exitCode !== 0) {\n            process.exit(exitCode);\n        }\n        return;\n    }\n\n    const session = await resolveLegacySessionIfAvailable(parsed.sessionId);\n    if (!session) {\n        throw localError;\n    }\n    const launch = buildResumeLaunch(session);\n\n    if (!existsSync(launch.cwd)) {\n        throw new Error(`Saved session path does not exist: ${launch.cwd}`);\n    }","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/resume/handleResumeCommand.ts#L149-L185","documentation":"handleResumeCommand throws this on the reconnect path: after building a ResumeLaunch for a reconnectable session, it checks existsSync(launch.cwd). The saved session's working directory (metadata.path) no longer exists on disk, so spawning the resume child there would fail.","triggerScenarios":"Running `happy resume <id>` where the session matches as reconnectable, but the directory stored in metadata.path was deleted, renamed, is on an unmounted volume, or the session was created on another machine and synced.","commonSituations":"Project folder deleted or moved after the session ended; working on a checkout on a removable/external drive that is not mounted; container/VM where the original path never existed; home directory layout changed.","solutions":["Restore or recreate the directory at the saved path (git clone the project again, mount the volume)","Update the session's saved path in the sessions file to the directory's new location","Start a new Happy session from the project's current path","List sessions to confirm which path is stored and correct it if it was moved"],"exampleFix":"// saved metadata.path = /home/me/old-project (deleted)\nmkdir -p /home/me/old-project && git -C /home/me/old-project clone git@github.com:me/old-project.git .\n// or edit sessionsFile path -> /home/me/new-project\n// then\nhappy resume <session-id>","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(session.metadata.path)) {\n  console.error(`Session directory ${session.metadata.path} is missing; restore it or start a new session.`);\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await handleResumeCommand([sessionId]);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Saved session path does not exist')) {\n    const dir = e.message.split(': ')[1];\n    console.error(`Recreate or remount ${dir}, or update the session's saved path.`);\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["existsSync() the saved path before calling handleResumeCommand","Keep project directories at stable paths or update sessionsFile after moving them","Mount external volumes before resuming sessions that live there","Use identical directory layouts when moving sessions across machines"],"tags":["filesystem","path-not-found","resume"],"backgroundTag":"path-does-not-exist","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}