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 '${header.cwd}' is not a directory What it means
Error "cannot attach session '${sessionId}' to workspace '${this.record.path}': its cwd '${header.cwd}' is not a directory" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/workspace/workspace/src/entity.ts:133
const header = await this.host.readSessionHeader(sessionId)
if (header.cwd === undefined) {
throw new Error(
`cannot attach session '${sessionId}' to workspace '${this.record.path}': `
+ 'its stored header carries no cwd to validate against',
)
}
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> {View on GitHub (pinned to b150a551b8)
Solutions
- Point the session's cwd at an existing directory, or create the directory, before attaching the session to the workspace.
When it happens
Trigger: Thrown at packages/workspace/workspace/src/entity.ts:133 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/a466e1e19b8f59cd.
Report an issue: GitHub.