deepseek-ai/deepseek-harness · error · TypeError

credentials-local: record "${key}" env "${name}" in ${filena

Error message

credentials-local: record "${key}" env "${name}" in ${filename} must be a non-empty string

What it means

Error "credentials-local: record "${key}" env "${name}" in ${filename} must be a non-empty string" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/credentials/credentials-local/src/index.ts:379

function assertFields(key: string, fields: Record<string, unknown>, allowed: string[], filename: string): void {
  for (const field of Object.keys(fields)) {
    if (!allowed.includes(field)) {
      throw new Error(`credentials-local: record "${key}" in ${filename} has unknown field "${field}"`)
    }
  }
}

/** Admit an api-key record's provider environment: POSIX names over non-empty strings. */
function parseRecordEnv(key: string, env: unknown, filename: string): Record<string, string> | undefined {
  if (env === undefined) return undefined
  if (typeof env !== 'object' || env === null || Array.isArray(env)) {
    throw new TypeError(`credentials-local: record "${key}" in ${filename} has a non-mapping env`)
  }
  const parsed: Record<string, string> = {}
  for (const [name, value] of Object.entries(env as Record<string, unknown>)) {
    credentialRef(name)
    if (typeof value !== 'string' || value.length === 0) {
      throw new TypeError(
        `credentials-local: record "${key}" env "${name}" in ${filename} must be a non-empty string`,
      )
    }
    parsed[name] = value
  }
  return parsed
}

/**
 * Reject a payload that cannot survive a JSON round trip, on the way in and on
 * the way out. The seam promises owners their payload comes back exactly as
 * written, and both directions can break that: a document may spell `.inf` or
 * an alias cycle, and an owner may hand over a `Date`, a class instance, or a
 * `bigint` that this document has no faithful spelling for. Neither the value
 * nor any nested value is quoted in a diagnostic.
 * @param where - the subject named in a diagnostic, already free of any value.
 * @param value - the payload or nested value to admit.
 * @param seen - objects on the current path, for cycle detection.

View on GitHub (pinned to b150a551b8)

When it happens

Trigger: Thrown at packages/credentials/credentials-local/src/index.ts:379 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/0252fe955e5e08b6. Report an issue: GitHub.