deepseek-ai/deepseek-harness · error · TypeError
credentials-local: the value for
Error message
credentials-local: the value for "${key}" in ${filename} must be a string What it means
Value validation in parseRefs: a refs entry's value is not a non-empty string. Reference values are plain string secrets/identifiers; numbers, booleans, null, or empty strings cannot be stored as a ref value.
Solutions
- Quote the value so YAML parses it as a non-empty string
- Replace null/empty values with the intended string
- Remove the key entirely if it should not exist
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/credentials/credentials-local/src/index.ts:279 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/61f3fa2bed5e8080.
Report an issue: GitHub.
Appendix: source
Thrown at packages/credentials/credentials-local/src/index.ts:279
}
if (!isScalar(pair.value) || typeof pair.value.value !== 'string' || pair.value.value.length === 0) return undefined
}
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
}View on GitHub (pinned to b150a551b8)