deepseek-ai/deepseek-harness · error

tool-session-query: ${operation} failed: ${diagnostic}

Error message

tool-session-query: ${operation} failed: ${diagnostic}

What it means

Error "tool-session-query: ${operation} failed: ${diagnostic}" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/session-query/tool-session-query/src/service-boundary.ts:124

  try {
    const value = await invoke()
    signal.throwIfAborted()
    return value
  } catch (error: unknown) {
    signal.throwIfAborted()
    throw sanitizeError(ctx, operation, error)
  }
}

function sanitizeError(
  ctx: Context,
  operation: string,
  error: unknown,
): HarnessError {
  const generic = genericFailure()
  const diagnostic = fullError(error)
  try {
    ctx.logger.warn(`tool-session-query: ${operation} failed: ${diagnostic}`)
    if (error instanceof SessionQueryError) {
      const code: unknown = error.code
      const failure = typeof code === 'string' && Object.hasOwn(SAFE_SESSION_QUERY_FAILURES, code)
        ? SAFE_SESSION_QUERY_FAILURES[code as SessionQueryErrorCode]
        : undefined
      if (failure !== undefined && failure.code !== 'SESSION_QUERY_TOOL_FAILED') {
        return new SessionQueryError(failure.message, failure.code)
      }
    }
    if (error instanceof HarnessError && error.code === 'SESSION_QUERY_TOOL_UNAUTHORIZED') {
      return unauthorizedTarget()
    }
  } catch {
    return generic
  }
  return generic
}

View on GitHub (pinned to b150a551b8)

Solutions

  1. Apply the diagnostic for the failed operation (fix filters, enable search, verify session id) and retry the tool call.

When it happens

Trigger: Thrown at packages/session-query/tool-session-query/src/service-boundary.ts:124 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/4ffd9d89c6767c4c. Report an issue: GitHub.