deepseek-ai/deepseek-harness · error · Error

credentials-local: unknown top-level key "${key}" in ${filen

Error message

credentials-local: unknown top-level key "${key}" in ${filename}

What it means

Error "credentials-local: unknown top-level key "${key}" in ${filename}" thrown in deepseek-ai/deepseek-harness.

Source

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

  // An empty (or comment-only) document is the empty store and needs no
  // version: there is nothing in it a later layout could have meant.
  if (keys.length === 0) return { refs: new Map(), records: new Map() }
  if (!('version' in fields)) {
    throw new Error(
      `credentials-local: ${filename} uses the pre-release flat layout. Add \`version: ${DOCUMENT_VERSION}\``
      + ` and nest the existing ${keys.length} ${keys.length === 1 ? 'entry' : 'entries'} under \`refs:\`.`
      + ' No values need to change.',
    )
  }
  if (fields['version'] !== DOCUMENT_VERSION) {
    throw new Error(
      `credentials-local: ${filename} declares version ${JSON.stringify(fields['version'])};`
      + ` this build reads version ${DOCUMENT_VERSION}`,
    )
  }
  for (const key of keys) {
    if (key !== 'version' && key !== 'refs' && key !== 'records') {
      throw new Error(`credentials-local: unknown top-level key "${key}" in ${filename}`)
    }
  }
  return { refs: parseRefs(fields['refs'], filename), records: parseRecords(fields['records'], filename) }
}

/**
 * Render the version-1 layout for a pre-release flat document, or `undefined`
 * for anything else. The flat layout is recognized exactly — a non-empty
 * top-level mapping of addressable reference names to non-empty string
 * scalars, with no `version` key and no document directives — and the rewrite
 * nests the original lines verbatim under `refs:` at two spaces' indent, so
 * comments, blank lines, and each value's spelling survive byte for byte.
 * Anything the recognizer declines keeps {@link parseCredentialsDocument}'s
 * loud rejection: a document this build cannot prove it understands is never
 * rewritten. Remove with the pre-release stance at the first tagged release.
 * @param text - the document's text.
 * @returns the migrated text, or `undefined` when the text is not the recognized flat layout.
 */

View on GitHub (pinned to b150a551b8)

When it happens

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