{"record":{"id":"8b3ec7697916122c","repo":"deepseek-ai/deepseek-harness","slug":"agent-initiator-scope-is-disposed","errorCode":null,"errorMessage":"agent initiator scope is disposed","messagePattern":"agent initiator scope is disposed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/agent/src/index.ts","lineNumber":641,"sourceCode":"\n  /** Wait for returned-Promise boundaries, then invalidate retained references. */\n  private disposeInitiators(): Promise<void> {\n    return (this.initiatorDisposal ??= (async () => {\n      this.closeInitiators()\n      this.releaseReentrantInitiatorRuns()\n      if (this.activeInitiatorRuns !== 0) {\n        this.initiatorDrain ??= Promise.withResolvers<void>()\n        await this.initiatorDrain.promise\n      }\n      this.initiatorState = 'disposed'\n      this.initiators.disable()\n      this.initiatorRuns.disable()\n    })())\n  }\n\n  /** Establish one tracked initiator or clearing boundary. */\n  private runWithInitiator<T>(agent: Agent | undefined, operation: () => T): T {\n    if (this.initiatorState !== 'active') throw new Error(DISPOSED_INITIATOR_MESSAGE)\n    const run: InitiatorRun = {\n      active: true,\n      parent: this.initiatorRuns.getStore(),\n    }\n    this.activeInitiatorRuns += 1\n    let result: T\n    try {\n      result = this.initiatorRuns.run(run, () => this.initiators.run(agent, operation))\n    } catch (error: unknown) {\n      this.releaseInitiatorRun(run)\n      throw error\n    }\n    if (isPromise(result)) {\n      try {\n        void Promise.prototype.then.call(\n          result,\n          () => { this.releaseInitiatorRun(run) },\n          () => { this.releaseInitiatorRun(run) },","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/agent/src/index.ts#L623-L659","documentation":"Error \"agent initiator scope is disposed\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/agent/src/index.ts:641 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not use the initiator scope after disposal; create a new scope."],"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"}