deepseek-ai/deepseek-harness · error

tool-session-query: failed

Error message

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

What it means

tool-session-query's sanitizeError: any operation failure is logged with its full diagnostic chain, then rethrown as a generic HarnessError (or the recognized SessionQueryError code) so internals never leak across the tool boundary.

Solutions

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

Strategy: fallback

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.

Appendix: 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)