{"record":{"id":"c1b2ec7cce1dd849","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-was-disposed-before-the-queued-c1b2ec","errorCode":null,"errorMessage":"credentials-local was disposed before the queued \"${ref}\" ${verb} ran","messagePattern":"credentials-local was disposed before the queued \"(.+?)\" (.+?) ran","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":761,"sourceCode":"      // Only an invariant violation escaping the update fan-out can reject a\n      // refresh; keep the operation queue alive and surface it as an error so\n      // one poisoned commit cannot silently end hot reloading forever.\n      this.ctx.logger.error('credentials-local: reload commit failed at %s', this.spec.filename)\n      this.ctx.logger.error(error)\n    })\n  }\n  /* jscpd:ignore-end */\n\n  /** Queue one line edit; entry checks reject early, the queue re-judges them at run time. */\n  private async write(ref: CredentialRef, value: string | undefined): Promise<void> {\n    const verb = value === undefined ? 'unset' : 'set'\n    if (this.isClosed()) {\n      throw new Error(`credentials-local is disposed: cannot ${verb} \"${ref}\"`)\n    }\n    this.assertUnshadowed(ref, verb)\n    return this.enqueue(async () => {\n      if (this.isClosed()) {\n        throw new Error(`credentials-local was disposed before the queued \"${ref}\" ${verb} ran`)\n      }\n      // Re-judged at run time: the environment may have changed while queued.\n      this.assertUnshadowed(ref, verb)\n      // The writer lock's exclusive create needs the parent to exist; 0700\n      // because the harness home holds user-private data.\n      await mkdir(dirname(this.spec.filename), { recursive: true, mode: 0o700 })\n      await withFileLock(this.spec.filename, async () => {\n        // Read-modify-write: fold in any on-disk state this process has not\n        // observed yet — an external edit still inside the watcher debounce\n        // window, a change the watcher missed, or another process's write —\n        // so the line edit below can never resurrect a stale document.\n        await this.reconcileFromDisk()\n        const existing = this.values.get(ref)\n        if (value === undefined && existing === undefined) return\n        const nextText = renderRef(this.text, ref, value)\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","sourceCodeStart":743,"sourceCodeEnd":779,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L743-L779","documentation":"Error \"credentials-local was disposed before the queued \"${ref}\" ${verb} ran\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:761 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"}