{"record":{"id":"4efdf322b5a9a8b7","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-is-disposed-cannot-delete-ke","errorCode":null,"errorMessage":"credentials-local is disposed: cannot delete \"${key}\"","messagePattern":"credentials-local is disposed: cannot delete \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":710,"sourceCode":"        // 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)\n        const nextText = renderRecord(this.text, key, next)\n        // 0600: a document holding secrets is never world-readable.\n        await writeFileAtomic(this.spec.filename, nextText, { mode: 0o600, dirMode: 0o700 })\n        this.text = nextText\n        this.records.set(key, next)\n        // After the commit, on the same terms as a reference write.\n        this.notifyRecordUpdated(key)\n        return next\n      }, { waitMs: DOCUMENT_LOCK_WAIT_MS })\n    })\n  }\n\n  override async deleteRecord(key: CredentialKey): Promise<void> {\n    if (this.isClosed()) throw new Error(`credentials-local is disposed: cannot delete \"${key}\"`)\n    await this.enqueue(async () => {\n      if (this.isClosed()) {\n        throw new Error(`credentials-local was disposed before the queued \"${key}\" delete ran`)\n      }\n      await mkdir(dirname(this.spec.filename), { recursive: true, mode: 0o700 })\n      await withFileLock(this.spec.filename, async () => {\n        await this.reconcileFromDisk()\n        if (!this.records.has(key)) return\n        const nextText = renderRecord(this.text, key, undefined)\n        await writeFileAtomic(this.spec.filename, nextText, { mode: 0o600, dirMode: 0o700 })\n        this.text = nextText\n        this.records.delete(key)\n        this.notifyRecordUpdated(key)\n      }, { waitMs: DOCUMENT_LOCK_WAIT_MS })\n    })\n  }\n\n  /* jscpd:ignore-start -- the operation-chain and reload lifecycle is the same","sourceCodeStart":692,"sourceCodeEnd":728,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L692-L728","documentation":"Error \"credentials-local is disposed: cannot delete \"${key}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:710 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"}