{"record":{"id":"700e89ab1f9d8ec2","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-is-disposed-cannot-modify-ke","errorCode":null,"errorMessage":"credentials-local is disposed: cannot modify \"${key}\"","messagePattern":"credentials-local is disposed: cannot modify \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":678,"sourceCode":"    // neither a key nor environment values is a deliberate statement rather\n    // than a blank.\n    if (stored === undefined) return Promise.resolve({ configured: false, writable: true })\n    return Promise.resolve({ configured: true, kind: stored.kind, writable: true })\n  }\n\n  override listRecords(): Promise<readonly CredentialRecordEntry[]> {\n    return Promise.resolve([...this.records].map(([key, record]) => ({\n      // The parser has already proven every stored key addressable.\n      key: parseCredentialKey(key),\n      kind: record.kind,\n    })))\n  }\n\n  override async modifyRecord(\n    key: CredentialKey,\n    mutate: (current: CredentialRecord | undefined) => Promise<CredentialRecord | undefined>,\n  ): Promise<CredentialRecord | undefined> {\n    if (this.isClosed()) throw new Error(`credentials-local is disposed: cannot modify \"${key}\"`)\n    return this.enqueue(async () => {\n      if (this.isClosed()) {\n        throw new Error(`credentials-local was disposed before the queued \"${key}\" modify ran`)\n      }\n      await mkdir(dirname(this.spec.filename), { recursive: true, mode: 0o700 })\n      return withFileLock(this.spec.filename, async () => {\n        // Read-modify-write: `mutate` must decide against the record as it\n        // stands now, not as this process last saw it — another process may\n        // have rotated it since.\n        await this.reconcileFromDisk()\n        const current = this.records.get(key)\n        const next = await mutate(current)\n        if (next === undefined) return current\n        // Admitted before it is rendered: what the read path would refuse is\n        // refused here first, so a caller can never persist a document the\n        // next boot rejects, and a value refused here has not been stored.\n        if (next.kind === 'grant') assertJsonValue(`record \"${key}\" payload`, next.payload, new Set())\n        else assertStorableApiKey(key, next)","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L660-L696","documentation":"Error \"credentials-local is disposed: cannot modify \"${key}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:678 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"}