deepseek-ai/deepseek-harness · error · AgentPresetConflict

agent-preset-conflict

agent-preset-conflict

Error message

error.message

What it means

Error-message passthrough guard in the api-proxy session-create path: a thrown Error (e.g. from session construction) is converted into a structured err() response whose message is the original error's message. Generic sentinel pattern — the meaning is whatever the inner operation failed on, surfaced to the client without losing text.

Solutions

  1. Read the forwarded error message in the response or logs and fix the underlying failure it names.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/host/apiproxy/src/api-proxy.ts:2098 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/0ac13a0dc474119d. Report an issue: GitHub.

Appendix: source

Thrown at packages/host/apiproxy/src/api-proxy.ts:2098

        const sessionId = request.payload.sessionId ?? `session-${randomUUID()}` as SessionId
        let workspace: Workspace | undefined
        if (request.payload.workspaceId !== undefined) {
          workspace = ctx.workspaceRegistry.get(brandWorkspaceId(request.payload.workspaceId))
          if (workspace === undefined) {
            return err(request, {
              code: 'workspace-not-found',
              message: `workspace "${request.payload.workspaceId}" not found`,
              details: { workspaceId: request.payload.workspaceId },
            })
          }
        }
        const cwd = workspace?.path ?? request.payload.cwd ?? defaults.cwd
        const requestedPreset = request.payload.agentPreset
        try {
          await ensureSession(sessionId, cwd, request.payload.sessionId !== undefined, requestedPreset)
        } catch (error: unknown) {
          if (error instanceof AgentPresetConflict) {
            return err(request, {
              code: 'agent-preset-conflict',
              message: error.message,
              details: {
                sessionId: error.sessionId,
                requestedPreset: error.requestedPreset,
                ...error.existingPreset === undefined ? {} : { existingPreset: error.existingPreset },
              },
            })
          }
          const refused = presetFailure(request, error)
          if (refused !== undefined) return refused
          if (error instanceof SessionCwdConflict) {
            return err(request, {
              code: 'session-conflict',
              message: error.message,
              details: {
                sessionId: error.sessionId,
                requestedCwd: error.requestedCwd,

View on GitHub (pinned to b150a551b8)