{"record":{"id":"753eaf3b406ee906","repo":"deepseek-ai/deepseek-harness","slug":"fork-unavailable","errorCode":"fork-unavailable","errorMessage":"session \"${sessionId}\" has not completed the turn containing event ${String(atSeq)}","messagePattern":"session \"(.+?)\" has not completed the turn containing event (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/host/apiproxy/src/api-proxy.ts","lineNumber":2291,"sourceCode":"            code: 'internal',\n            message: `fork source unavailable for session \"${sessionId}\": ${String(error)}`,\n            details: {},\n          })\n        }\n        const events = source.events\n        // An in-log anchor belongs to the turn containing it and must never\n        // clip backward to an earlier completed turn. Omitted and past-end\n        // anchors retain the last-completed-turn shortcut.\n        const lastSeq = events.at(-1)?.seq ?? -1\n        const anchoredBoundary = atSeq === undefined\n          ? undefined\n          : events.find(e => e.type === 'turn/end' && e.seq >= atSeq)\n        const boundary = anchoredBoundary\n          ?? (atSeq === undefined || atSeq > lastSeq\n            ? events.findLast(e => e.type === 'turn/end')\n            : undefined)\n        if (boundary === undefined) {\n          return err(request, {\n            code: 'fork-unavailable',\n            message: atSeq !== undefined && atSeq <= lastSeq\n              ? `session \"${sessionId}\" has not completed the turn containing event ${String(atSeq)}`\n              : `session \"${sessionId}\" has no completed turn to fork from`,\n            details: { sessionId },\n          })\n        }\n        // Extend the cut through trailing out-of-band appends (session/title,\n        // injections) up to the next turn/start: they are standalone events, so\n        // the seed stays balanced, and the child inherits a title generated\n        // right after the boundary turn.\n        let cut = boundary.seq + 1\n        while (cut < events.length && events[cut]?.type !== 'turn/start') cut++\n        let workspace: Workspace | undefined\n        try {\n          workspace = await forkWorkspace(source)\n        } catch (error: unknown) {\n          return err(request, {","sourceCodeStart":2273,"sourceCodeEnd":2309,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/host/apiproxy/src/api-proxy.ts#L2273-L2309","documentation":"Error \"session \"${sessionId}\" has not completed the turn containing event ${String(atSeq)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/host/apiproxy/src/api-proxy.ts:2291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait until the turn containing the event completes before requesting data at that sequence."],"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"}