{"record":{"id":"a5c1f514c5f0836d","repo":"deepseek-ai/deepseek-harness","slug":"cannot-move-session-sessionid-before-befor","errorCode":null,"errorMessage":"cannot move session '${sessionId}' before '${beforeSessionId}' in workspace '${record.path}': the anchor session is not accounted","messagePattern":"cannot move session '(.+?)' before '(.+?)' in workspace '(.+?)': the anchor session is not accounted","errorType":"exception","errorClass":"WorkspaceMoveInvalidError","httpStatus":null,"severity":"error","filePath":"packages/workspace/workspace/src/entity.ts","lineNumber":159,"sourceCode":"          + `its cwd resolves to '${cwd}'`,\n        )\n      }\n      this.host.rememberSessionPath(sessionId, cwd)\n    }\n    await this.mutate(record => record.sessionIds.includes(sessionId)\n      ? record\n      : { ...record, sessionIds: [sessionId, ...record.sessionIds] })\n  }\n\n  async insertSessionBefore(sessionId: SessionId, beforeSessionId?: SessionId): Promise<void> {\n    await this.mutate((record) => {\n      if (!record.sessionIds.includes(sessionId)) {\n        throw new WorkspaceMoveInvalidError(\n          `cannot move session '${sessionId}' in workspace '${record.path}': the session is not accounted`,\n        )\n      }\n      if (beforeSessionId !== undefined && !record.sessionIds.includes(beforeSessionId)) {\n        throw new WorkspaceMoveInvalidError(\n          `cannot move session '${sessionId}' before '${beforeSessionId}' in workspace '${record.path}': `\n          + 'the anchor session is not accounted',\n        )\n      }\n      if (beforeSessionId === sessionId) return record\n      const without = record.sessionIds.filter(id => id !== sessionId)\n      const at = beforeSessionId === undefined ? without.length : without.indexOf(beforeSessionId)\n      const sessionIds = [...without.slice(0, at), sessionId, ...without.slice(at)]\n      return sessionIds.every((id, index) => id === record.sessionIds[index])\n        ? record\n        : { ...record, sessionIds }\n    })\n  }\n\n  async detachSession(sessionId: SessionId): Promise<void> {\n    await this.mutate(record => record.sessionIds.includes(sessionId)\n      ? { ...record, sessionIds: record.sessionIds.filter(id => id !== sessionId) }\n      : record)","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workspace/workspace/src/entity.ts#L141-L177","documentation":"Error \"cannot move session '${sessionId}' before '${beforeSessionId}' in workspace '${record.path}': the anchor session is not accounted\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workspace/workspace/src/entity.ts:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick an anchor session that is accounted by the workspace, or attach the anchor session 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"}