{"record":{"id":"eb0a2b0917e88681","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-was-disposed-before-the-queued-eb0a2b","errorCode":null,"errorMessage":"credentials-local was disposed before the queued \"${key}\" delete ran","messagePattern":"credentials-local was disposed before the queued \"(.+?)\" delete ran","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":713,"sourceCode":"        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\n     reviewed contract as settings-file, deliberately mirrored (prefer symmetry\n     for parallel values); the two providers own different documents and\n     failure policies, so extracting a shared helper would couple their teardown","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L695-L731","documentation":"Error \"credentials-local was disposed before the queued \"${key}\" delete ran\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:713 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"}