deepseek-ai/deepseek-harness · error · Error

credentials-local: the value for

Error message

credentials-local: the value for "${key}" in ${filename} is empty; remove the key instead

What it means

Emptiness guard in parseRefs: a refs key exists with an empty-string value. An empty ref is indistinguishable from an unset one at read time and usually signals a placeholder; the document rejects it and tells you to remove the key instead.

Solutions

  1. Remove the empty key from the refs section
  2. Fill in the actual credential value
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

  const body = text.split('\n').map(line => (line.length === 0 ? line : `  ${line}`)).join('\n')
  return `version: ${DOCUMENT_VERSION}\nrefs:\n${body}${text.endsWith('\n') ? '' : '\n'}`
}

/** Admit a `refs` section: POSIX-identifier keys over non-empty string values. */
function parseRefs(section: unknown, filename: string): Map<string, string> {
  const entries = new Map<string, string>()
  for (const [key, value] of Object.entries(asSection(section, 'refs', filename))) {
    // credentialRef throws on anything that is not a POSIX identifier, which
    // is exactly the constraint a stored reference must satisfy to be
    // addressable through the seam.
    credentialRef(key)
    // The key name is quoted, never the value: a wrong-typed entry is still a
    // secret the user meant to store.
    if (typeof value !== 'string') {
      throw new TypeError(`credentials-local: the value for "${key}" in ${filename} must be a string`)
    }
    if (value.length === 0) {
      throw new Error(`credentials-local: the value for "${key}" in ${filename} is empty; remove the key instead`)
    }
    entries.set(key, value)
  }
  return entries
}

/** Admit a `records` section: `<scope>/<id>` keys over tagged record mappings. */
function parseRecords(section: unknown, filename: string): Map<string, CredentialRecord> {
  const entries = new Map<string, CredentialRecord>()
  for (const [key, value] of Object.entries(asSection(section, 'records', filename))) {
    parseCredentialKey(key)
    entries.set(key, parseRecord(key, value, filename))
  }
  return entries
}

/**
 * Refuse an api-key record the read path could not admit, before it is

View on GitHub (pinned to b150a551b8)