{"record":{"id":"e3d9ee57f4017d54","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-record-key-has-an-empty-ke","errorCode":null,"errorMessage":"credentials-local: record \"${key}\" has an empty key; omit the field instead","messagePattern":"credentials-local: record \"(.+?)\" has an empty key; omit the field instead","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":309,"sourceCode":"  const entries = new Map<string, CredentialRecord>()\n  for (const [key, value] of Object.entries(asSection(section, 'records', filename))) {\n    parseCredentialKey(key)\n    entries.set(key, parseRecord(key, value, filename))\n  }\n  return entries\n}\n\n/**\n * Refuse an api-key record the read path could not admit, before it is\n * rendered: an empty key, an env name outside the reference grammar, or an\n * empty env value would persist a document `parseRecord` rejects at the next\n * boot — a durable-boundary write is validated where it is written.\n * @param key - the record's credential key, for the failure message.\n * @param record - the api-key record a mutation returned.\n */\nfunction assertStorableApiKey(key: CredentialKey, record: ApiKeyRecord): void {\n  if (record.key !== undefined && record.key.length === 0) {\n    throw new TypeError(`credentials-local: record \"${key}\" has an empty key; omit the field instead`)\n  }\n  for (const [name, value] of Object.entries(record.env ?? {})) {\n    credentialRef(name)\n    if (value.length === 0) {\n      throw new TypeError(`credentials-local: record \"${key}\" env \"${name}\" must be a non-empty string`)\n    }\n  }\n}\n\n/** One section of the document as a plain mapping; absent and null both mean empty. */\nfunction asSection(section: unknown, name: string, filename: string): Record<string, unknown> {\n  if (section === undefined || section === null) return {}\n  if (typeof section !== 'object' || Array.isArray(section)) {\n    throw new TypeError(`credentials-local: \"${name}\" in ${filename} must be a mapping`)\n  }\n  return section as Record<string, unknown>\n}\n","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L291-L327","documentation":"Error \"credentials-local: record \"${key}\" has an empty key; omit the field instead\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}