deepseek-ai/deepseek-harness · error · Error

cannot attach session '${sessionId}' to workspace '${this.re

Error message

cannot attach session '${sessionId}' to workspace '${this.record.path}': its cwd resolves to '${cwd}'

What it means

Error "cannot attach session '${sessionId}' to workspace '${this.record.path}': its cwd resolves to '${cwd}'" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/workspace/workspace/src/entity.ts:139

      }
      let cwd: string
      try {
        cwd = await realpathNormalize(header.cwd)
      } catch (error) {
        throw new Error(
          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `
          + `its cwd '${header.cwd}' does not resolve, so it cannot be validated`,
          { cause: error },
        )
      }
      if (!(await stat(cwd)).isDirectory()) {
        throw new Error(
          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `
          + `its cwd '${header.cwd}' is not a directory`,
        )
      }
      if (cwd !== this.record.path) {
        throw new Error(
          `cannot attach session '${sessionId}' to workspace '${this.record.path}': `
          + `its cwd resolves to '${cwd}'`,
        )
      }
      this.host.rememberSessionPath(sessionId, cwd)
    }
    await this.mutate(record => record.sessionIds.includes(sessionId)
      ? record
      : { ...record, sessionIds: [sessionId, ...record.sessionIds] })
  }

  async insertSessionBefore(sessionId: SessionId, beforeSessionId?: SessionId): Promise<void> {
    await this.mutate((record) => {
      if (!record.sessionIds.includes(sessionId)) {
        throw new WorkspaceMoveInvalidError(
          `cannot move session '${sessionId}' in workspace '${record.path}': the session is not accounted`,
        )
      }

View on GitHub (pinned to b150a551b8)

Solutions

  1. Attach only sessions whose cwd resolves inside the workspace path; move the session or pick the matching workspace.

When it happens

Trigger: Thrown at packages/workspace/workspace/src/entity.ts:139 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/b5b3da1633b411fd. Report an issue: GitHub.