{"record":{"id":"67c90c12942cb2ee","repo":"deepseek-ai/deepseek-harness","slug":"no-session","errorCode":"NO_SESSION","errorMessage":"unknown PTY session ${id}","messagePattern":"unknown PTY session (.+?)","errorType":"exception","errorClass":"TerminalError","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal/src/index.ts","lineNumber":389,"sourceCode":"    if (owned.size === 0) this.pendingSpawns.delete(pending.owner)\n  }\n\n  private async abortPendingSpawns(owner: Agent | undefined, reason: TerminalError): Promise<void> {\n    const pending = owner === undefined\n      ? [...this.pendingSpawns.values()].flatMap(owned => [...owned])\n      : [...(this.pendingSpawns.get(owner) ?? [])]\n    for (const spawn of pending) spawn.controller.abort(reason)\n    await Promise.all(pending.map(spawn => spawn.settled))\n    const failures = pending.flatMap(spawn => spawn.cleanupFailure === undefined ? [] : [spawn.cleanupFailure.error])\n    for (const spawn of pending) this.removePendingSpawn(spawn)\n    if (failures.length > 0) {\n      throw new AggregateError(failures, 'failed to roll back unpublished PTY setup')\n    }\n  }\n\n  private expectOwned(owner: Agent, id: TerminalSessionId): SessionRecord {\n    const record = this.sessions.get(id)\n    if (record === undefined) throw new TerminalError(`unknown PTY session ${id}`, 'NO_SESSION')\n    if (record.owner !== owner) throw new TerminalError(`PTY session ${id} belongs to another agent`, 'FOREIGN_SESSION')\n    return record\n  }\n\n  private snapshot(record: SessionRecord): TerminalSessionSnapshot\n  private snapshot(record: SessionRecord, motd: string): TerminalSpawnResult\n  private snapshot(record: SessionRecord, motd?: string): TerminalSpawnResult | TerminalSessionSnapshot {\n    return {\n      sessionId: record.id,\n      ...record.name !== undefined ? { name: record.name } : {},\n      type: record.type,\n      ...record.session.pid !== undefined ? { pid: record.session.pid } : {},\n      status: record.session.status(),\n      ...motd !== undefined ? { motd } : {},\n    }\n  }\n\n  private async abortAndClose(owner: Agent | undefined, abortReason: TerminalError, closeReason: string): Promise<void> {","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal/src/index.ts#L371-L407","documentation":"Error \"unknown PTY session ${id}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal/src/index.ts:389 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the id of an existing PTY session; list sessions to find valid ids."],"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"}