{"record":{"id":"e0529d0e5be3a35b","repo":"deepseek-ai/deepseek-harness","slug":"session-conflict","errorCode":"session-conflict","errorMessage":"session \"${sessionId}\" already exists with cwd ${JSON.stringify(existingCwd)}; requested ${JSON.stringify(requestedCwd)}","messagePattern":"session \"(.+?)\" already exists with cwd (.+?); requested (.+?)","errorType":"exception","errorClass":"SessionCwdConflict","httpStatus":null,"severity":"error","filePath":"packages/host/apiproxy/src/api-proxy.ts","lineNumber":1645,"sourceCode":"        }\n        const attached = ctx.sessions.get(sessionId)\n        if (attached !== undefined && hasSubagentOwner(attached, undefined)) {\n          throw new SubagentSessionOwnership(sessionId)\n        }\n        throw error\n      }).finally(() => {\n        sessionCreations.delete(sessionId)\n      })\n      sessionCreations.set(sessionId, creation)\n    }\n    const agent = await creation\n    if (hasSubagentOwner(agent.session, agent)) throw new SubagentSessionOwnership(sessionId)\n    // Beside the cwd check for the same reason, and after the await so it\n    // covers every path that yields a live agent — freshly created, adopted\n    // live, resumed from disk, or recovered by the concurrent-creation catch.\n    assertPresetUnchanged(sessionId, presetId, resolveSessionPreset(agent.session))\n    if (agent.session.header.cwd !== cwd) {\n      throw new SessionCwdConflict(sessionId, cwd, agent.session.header.cwd)\n    }\n    return agent\n  }\n\n  /** Resolve or create one path while holding the Host's workspace-create chain. */\n  function ensureWorkspace(path: string): Promise<{ workspace: Workspace; created: boolean }> {\n    const operation = workspaceCreationChain.then(async () => {\n      const existing = await ctx.workspaceRegistry.resolveByPath(path)\n      if (existing !== undefined) return { workspace: existing, created: false }\n      return { workspace: await ctx.workspaceRegistry.create(path), created: true }\n    })\n    workspaceCreationChain = operation.then(() => undefined, () => undefined)\n    return operation\n  }\n\n  /**\n   * Build the session.list baseline shared by listing and search visibility.\n   * Attached sessions come from memory; servable cold sessions merge from","sourceCodeStart":1627,"sourceCodeEnd":1663,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/host/apiproxy/src/api-proxy.ts#L1627-L1663","documentation":"Error \"session \"${sessionId}\" already exists with cwd ${JSON.stringify(existingCwd)}; requested ${JSON.stringify(requestedCwd)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/host/apiproxy/src/api-proxy.ts:1645 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}