{"record":{"id":"7f3bce6cc4c64dea","repo":"deepseek-ai/deepseek-harness","slug":"service-disposing","errorCode":"SERVICE_DISPOSING","errorMessage":"PTY service is disposing","messagePattern":"PTY service is disposing","errorType":"exception","errorClass":"TerminalError","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal/src/index.ts","lineNumber":315,"sourceCode":"    } catch (error) {\n      record.closing = undefined\n      throw error\n    }\n  }\n\n  /**\n   * List fresh snapshots for exactly one owner.\n   * @param owner - exact owner whose sessions are visible.\n   * @returns owner-visible snapshots in publication order.\n   */\n  list(owner: Agent): TerminalSessionSnapshot[] {\n    return [...this.sessions.values()]\n      .filter(record => record.owner === owner)\n      .map(record => this.snapshot(record))\n  }\n\n  private assertActive(): void {\n    if (this.disposing) throw new TerminalError('PTY service is disposing', 'SERVICE_DISPOSING')\n  }\n\n  private isLiveOwner(owner: Agent): boolean {\n    return !this.disposedOwners.has(owner) && this.ctx.get('agents')?.get(owner.id) === owner\n  }\n\n  private ensureOwnerCleanup(owner: Agent): void {\n    if (!this.isLiveOwner(owner)) {\n      throw new TerminalError(`agent \"${owner.id}\" is not the registered PTY owner`, 'OWNER_NOT_LIVE')\n    }\n    if (this.ownerCleanups.has(owner)) return\n    const detach = owner.ctx.effect(() => async () => {\n      this.disposedOwners.add(owner)\n      this.ownerCleanups.delete(owner)\n      await this.disposeOwned(owner)\n    }, 'pty.ownerCleanup()')\n    this.ownerCleanups.set(owner, detach)\n  }","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal/src/index.ts#L297-L333","documentation":"Error \"PTY service is disposing\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal/src/index.ts:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not start new PTY operations while the service is disposing; wait and recreate the service."],"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"}