deepseek-ai/deepseek-harness · error · TypeError
credentials-local: record "${key}" in ${filename} must be a
Error message
credentials-local: record "${key}" in ${filename} must be a mapping What it means
Error "credentials-local: record "${key}" in ${filename} must be a mapping" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/credentials/credentials-local/src/index.ts:331
if (value.length === 0) {
throw new TypeError(`credentials-local: record "${key}" env "${name}" must be a non-empty string`)
}
}
}
/** One section of the document as a plain mapping; absent and null both mean empty. */
function asSection(section: unknown, name: string, filename: string): Record<string, unknown> {
if (section === undefined || section === null) return {}
if (typeof section !== 'object' || Array.isArray(section)) {
throw new TypeError(`credentials-local: "${name}" in ${filename} must be a mapping`)
}
return section as Record<string, unknown>
}
/** Admit one record entry, rejecting an unknown tag or field rather than dropping it. */
function parseRecord(key: string, value: unknown, filename: string): CredentialRecord {
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
throw new TypeError(`credentials-local: record "${key}" in ${filename} must be a mapping`)
}
const fields = value as Record<string, unknown>
const kind = fields['kind']
if (kind === 'api-key') {
assertFields(key, fields, ['kind', 'key', 'env'], filename)
const apiKey = fields['key']
if (apiKey !== undefined && (typeof apiKey !== 'string' || apiKey.length === 0)) {
throw new TypeError(`credentials-local: record "${key}" in ${filename} has a non-string or empty key`)
}
const env = parseRecordEnv(key, fields['env'], filename)
return {
kind: 'api-key',
...apiKey === undefined ? {} : { key: apiKey },
...env === undefined ? {} : { env },
}
}
if (kind === 'grant') {
assertFields(key, fields, ['kind', 'payload'], filename)View on GitHub (pinned to b150a551b8)
When it happens
Trigger: Thrown at packages/credentials/credentials-local/src/index.ts:331 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/bca8494911723513.
Report an issue: GitHub.