{"record":{"id":"edf5007968798a5b","repo":"deepseek-ai/deepseek-harness","slug":"agent-preset-locked","errorCode":"agent-preset-locked","errorMessage":"session \"${sessionId}\" has already started; its agent preset is fixed","messagePattern":"session \"(.+?)\" has already started; its agent preset is fixed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/host/apiproxy/src/api-proxy.ts","lineNumber":3004,"sourceCode":"      // agent and the session survive, only the composition is swapped.\n      async select(request) {\n        const { sessionId, agentPreset } = request.payload\n        const presets = ctx.get('agentPresets')\n        if (presets === undefined) {\n          return err(request, {\n            code: 'agent-preset-not-found',\n            message: 'this deployment composes no agent presets',\n            details: { agentPreset, available: [] },\n          })\n        }\n        const found = await agentFor(sessionId)\n        if ('error' in found) return err(request, found.error)\n        const { agent } = found\n        const swap = async (): Promise<RpcResponse<{ agentPreset: string }>> => {\n          // Re-read inside the queue: an earlier switch may have run, and a\n          // conversation may have started, since this request arrived.\n          if (!sessionBlank(agent.session)) {\n            return err(request, {\n              code: 'agent-preset-locked',\n              message: `session \"${sessionId}\" has already started; its agent preset is fixed`,\n              details: { sessionId, agentPreset },\n            })\n          }\n          try {\n            const preset = await presets.recompose(agent.ctx, agentPreset)\n            // Recorded only after the swap committed: the log states what the\n            // agent runs, and a rejected mount leaves the previous composition.\n            agent.session.append('agent-preset/selected', { agentPreset: preset.id })\n            return ok(request, { agentPreset: preset.id })\n          } catch (error: unknown) {\n            const refused = presetFailure(request, error)\n            if (refused !== undefined) return refused\n            return err(request, {\n              code: 'internal',\n              message: `failed to select agent preset \"${agentPreset}\": ${String(error)}`,\n              details: {},","sourceCodeStart":2986,"sourceCodeEnd":3022,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/host/apiproxy/src/api-proxy.ts#L2986-L3022","documentation":"Error \"session \"${sessionId}\" has already started; its agent preset is fixed\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/host/apiproxy/src/api-proxy.ts:3004 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The agent preset is fixed once a session has started; create a new session with the desired preset."],"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"}