{"record":{"id":"4a4b1a70663f0b1e","repo":"deepseek-ai/deepseek-harness","slug":"cannot-create-a-workspace-at-canonical-path","errorCode":null,"errorMessage":"cannot create a workspace at '${canonical}': path is not a directory","messagePattern":"cannot create a workspace at '(.+?)': path is not a directory","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workspace/workspace/src/index.ts","lineNumber":161,"sourceCode":"   * Create or reuse a workspace for an existing directory. The path is\n   * canonicalized through `fs.realpath`; a nonexistent path rejects with the\n   * original error and a non-directory rejects. Repeated calls for the same\n   * canonical path return the existing entity without changing its title.\n   * A newly created workspace is prepended to the durable registry order.\n   * Different canonical paths may share a display title.\n   * @param path - Existing directory to own, in any path spelling.\n   * @param title - Display title used only when a new record is created.\n   * @returns the existing or newly durable workspace.\n   */\n  // TODO: `title` lost its last production caller when the gateway's\n  // create-by-name branch was deleted\n  // (.agents/notes/implemented/simplification/2026-07-31-one-route-to-add-a-workspace.md);\n  // drop the parameter with its @param clause and the `create(path, title?)`\n  // lines in this package's README pair.\n  async create(path: string, title?: string): Promise<Workspace> {\n    const canonical = await realpathNormalize(path)\n    if (!(await stat(canonical)).isDirectory()) {\n      throw new Error(`cannot create a workspace at '${canonical}': path is not a directory`)\n    }\n    return await this.enqueueOperation(() => this.createCanonical(canonical, title))\n  }\n\n  /**\n   * Look up a workspace by id.\n   * @param id - Workspace id.\n   * @returns the workspace, or `undefined` when unknown.\n   */\n  get(id: WorkspaceId): Workspace | undefined {\n    return this.entities.get(id)\n  }\n\n  /**\n   * Synchronous workspace projection in durable registry order. Every\n   * entity's `sessionIds` getter is already filtered by the startup/live\n   * canonical-cwd header index; this method performs no persistence reads.\n   * @returns a fresh ordered array of workspace entities.","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workspace/workspace/src/index.ts#L143-L179","documentation":"Error \"cannot create a workspace at '${canonical}': path is not a directory\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workspace/workspace/src/index.ts:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the workspace at an existing directory path, or create the directory first."],"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"}