{"record":{"id":"aff74e38c7f8eb69","repo":"deepseek-ai/deepseek-harness","slug":"pty-spawn-and-rollback-both-failed","errorCode":null,"errorMessage":"PTY spawn and rollback both failed","messagePattern":"PTY spawn and rollback both failed","errorType":"exception","errorClass":"AggregateError","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal/src/index.ts","lineNumber":217,"sourceCode":"      }\n      let rollbackFailure: { error: unknown } | undefined\n      if (session !== undefined && !this.sessions.has(sessionId)) {\n        try {\n          await session.close('PTY spawn rolled back')\n        } catch (closeError: unknown) {\n          rollbackFailure = { error: closeError }\n          cleanupFailure = rollbackFailure\n        }\n      }\n      let failure: unknown = error\n      try {\n        signal?.throwIfAborted()\n        spawnReservation.signal.throwIfAborted()\n      } catch (cancellation: unknown) {\n        failure = cancellation\n      }\n      if (rollbackFailure !== undefined && signal?.aborted !== true) {\n        throw new AggregateError([failure, rollbackFailure.error], 'PTY spawn and rollback both failed')\n      }\n      throw failure\n    } finally {\n      spawnReservation.release(cleanupFailure)\n      releaseName()\n    }\n  }\n\n  /**\n   * Test whether an exact owner has a published session or unpublished spawn.\n   * @param owner - exact live owner to inspect.\n   * @returns true across the entire spawn-to-close interval, with no publication gap.\n   */\n  hasOwnerActivity(owner: Agent): boolean {\n    return (this.pendingSpawns.get(owner)?.size ?? 0) > 0\n      || [...this.sessions.values()].some(record => record.owner === owner)\n  }\n","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal/src/index.ts#L199-L235","documentation":"Error \"PTY spawn and rollback both failed\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal/src/index.ts:217 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the spawn failure cause first, then remove the leftover PTY resources reported by the rollback failure."],"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"}