{"record":{"id":"a466e1e19b8f59cd","repo":"deepseek-ai/deepseek-harness","slug":"cannot-attach-session-sessionid-to-workspace-a466e1","errorCode":null,"errorMessage":"cannot attach session '${sessionId}' to workspace '${this.record.path}': its cwd '${header.cwd}' is not a directory","messagePattern":"cannot attach session '(.+?)' to workspace '(.+?)': its cwd '(.+?)' is not a directory","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workspace/workspace/src/entity.ts","lineNumber":133,"sourceCode":"      const header = await this.host.readSessionHeader(sessionId)\n      if (header.cwd === undefined) {\n        throw new Error(\n          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `\n          + 'its stored header carries no cwd to validate against',\n        )\n      }\n      let cwd: string\n      try {\n        cwd = await realpathNormalize(header.cwd)\n      } catch (error) {\n        throw new Error(\n          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `\n          + `its cwd '${header.cwd}' does not resolve, so it cannot be validated`,\n          { cause: error },\n        )\n      }\n      if (!(await stat(cwd)).isDirectory()) {\n        throw new Error(\n          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `\n          + `its cwd '${header.cwd}' is not a directory`,\n        )\n      }\n      if (cwd !== this.record.path) {\n        throw new Error(\n          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `\n          + `its cwd resolves to '${cwd}'`,\n        )\n      }\n      this.host.rememberSessionPath(sessionId, cwd)\n    }\n    await this.mutate(record => record.sessionIds.includes(sessionId)\n      ? record\n      : { ...record, sessionIds: [sessionId, ...record.sessionIds] })\n  }\n\n  async insertSessionBefore(sessionId: SessionId, beforeSessionId?: SessionId): Promise<void> {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workspace/workspace/src/entity.ts#L115-L151","documentation":"Error \"cannot attach session '${sessionId}' to workspace '${this.record.path}': its cwd '${header.cwd}' is not a directory\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workspace/workspace/src/entity.ts:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the session's cwd at an existing directory, or create the directory, before attaching the session to the workspace."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}