deepseek-ai/deepseek-harness · error · TerminalError

SERVICE_DISPOSING

SERVICE_DISPOSING

Error message

PTY service is disposing

What it means

Error "PTY service is disposing" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/terminal/terminal/src/index.ts:315

    } catch (error) {
      record.closing = undefined
      throw error
    }
  }

  /**
   * List fresh snapshots for exactly one owner.
   * @param owner - exact owner whose sessions are visible.
   * @returns owner-visible snapshots in publication order.
   */
  list(owner: Agent): TerminalSessionSnapshot[] {
    return [...this.sessions.values()]
      .filter(record => record.owner === owner)
      .map(record => this.snapshot(record))
  }

  private assertActive(): void {
    if (this.disposing) throw new TerminalError('PTY service is disposing', 'SERVICE_DISPOSING')
  }

  private isLiveOwner(owner: Agent): boolean {
    return !this.disposedOwners.has(owner) && this.ctx.get('agents')?.get(owner.id) === owner
  }

  private ensureOwnerCleanup(owner: Agent): void {
    if (!this.isLiveOwner(owner)) {
      throw new TerminalError(`agent "${owner.id}" is not the registered PTY owner`, 'OWNER_NOT_LIVE')
    }
    if (this.ownerCleanups.has(owner)) return
    const detach = owner.ctx.effect(() => async () => {
      this.disposedOwners.add(owner)
      this.ownerCleanups.delete(owner)
      await this.disposeOwned(owner)
    }, 'pty.ownerCleanup()')
    this.ownerCleanups.set(owner, detach)
  }

View on GitHub (pinned to b150a551b8)

Solutions

  1. Do not start new PTY operations while the service is disposing; wait and recreate the service.

When it happens

Trigger: Thrown at packages/terminal/terminal/src/index.ts:315 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/7f3bce6cc4c64dea. Report an issue: GitHub.