{"record":{"id":"9b2bd582fa360f9c","repo":"deepseek-ai/deepseek-harness","slug":"pty-backend-startup-and-cleanup-both-failed","errorCode":null,"errorMessage":"PTY backend startup and cleanup both failed","messagePattern":"PTY backend startup and cleanup both failed","errorType":"exception","errorClass":"TerminalBackendCleanupError","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal-bash/src/index.ts","lineNumber":199,"sourceCode":"    if (argv[0] === undefined) throw new Error('terminal-bash: sandbox returned empty argv')\n    const terminal = await this.spawnTerminal({\n      argv,\n      cwd: spec.cwd ?? policy.workspaceRoot,\n      env: childEnvironment(spec, this.config.shellDialect),\n      rows: this.config.rows,\n      cols: this.config.cols,\n      graceMs: this.config.disposeGraceMs,\n      signal: spec.signal,\n    })\n    const session = this.createSession(terminal, this.config)\n    try {\n      await startupSession(session, this.config.shellDialect, spec.signal)\n      return session\n    } catch (error) {\n      try {\n        await session.close('PTY startup failed')\n      } catch (closeError: unknown) {\n        throw new TerminalBackendCleanupError(error, closeError)\n      }\n      throw error\n    }\n  }\n}\n\n/** Register the local PTY backend. */\nexport function apply(ctx: Context, config: Config): void {\n  const resolved = resolveConfig(config)\n  validateConfig(resolved)\n  ctx.terminals.registerBackend(new BashTerminalBackend(ctx, resolved))\n}\n","sourceCodeStart":181,"sourceCodeEnd":212,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal-bash/src/index.ts#L181-L212","documentation":"Error \"PTY backend startup and cleanup both failed\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal-bash/src/index.ts:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the startup failure cause first, then clean up the leftover backend resources reported by the cleanup 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"}