deepseek-ai/deepseek-harness · error · WorkspaceMoveInvalidError
cannot move session '${sessionId}' before '${beforeSessionId
Error message
cannot move session '${sessionId}' before '${beforeSessionId}' in workspace '${record.path}': the anchor session is not accounted What it means
Error "cannot move session '${sessionId}' before '${beforeSessionId}' in workspace '${record.path}': the anchor session is not accounted" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/workspace/workspace/src/entity.ts:159
+ `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`,
)
}
if (beforeSessionId !== undefined && !record.sessionIds.includes(beforeSessionId)) {
throw new WorkspaceMoveInvalidError(
`cannot move session '${sessionId}' before '${beforeSessionId}' in workspace '${record.path}': `
+ 'the anchor session is not accounted',
)
}
if (beforeSessionId === sessionId) return record
const without = record.sessionIds.filter(id => id !== sessionId)
const at = beforeSessionId === undefined ? without.length : without.indexOf(beforeSessionId)
const sessionIds = [...without.slice(0, at), sessionId, ...without.slice(at)]
return sessionIds.every((id, index) => id === record.sessionIds[index])
? record
: { ...record, sessionIds }
})
}
async detachSession(sessionId: SessionId): Promise<void> {
await this.mutate(record => record.sessionIds.includes(sessionId)
? { ...record, sessionIds: record.sessionIds.filter(id => id !== sessionId) }
: record)View on GitHub (pinned to b150a551b8)
Solutions
- Pick an anchor session that is accounted by the workspace, or attach the anchor session first.
When it happens
Trigger: Thrown at packages/workspace/workspace/src/entity.ts:159 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/a5c1f514c5f0836d.
Report an issue: GitHub.