{"record":{"id":"006d3398826b0c09","repo":"diegosouzapw/OmniRoute","slug":"chatgpt-web-codex-supervisor-is-already-owned-by","errorCode":null,"errorMessage":"ChatGPT Web (Codex) supervisor is already owned by process ${ownerPid}","messagePattern":"ChatGPT Web \\(Codex\\) supervisor is already owned by process (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/chatgpt-web-codex/tunnelClient.ts","lineNumber":166,"sourceCode":"        closeSync(fd);\n      }\n      ownsSupervisorLease = true;\n      return;\n    } catch (error) {\n      if ((error as NodeJS.ErrnoException).code !== \"EEXIST\") throw error;\n      let ownerPid = 0;\n      try {\n        const lease = JSON.parse(readFileSync(path, \"utf8\")) as Partial<SupervisorLease>;\n        ownerPid = Number(lease.pid) || 0;\n      } catch {\n        ownerPid = 0;\n      }\n      if (ownerPid === process.pid) {\n        ownsSupervisorLease = true;\n        return;\n      }\n      if (processIsAlive(ownerPid)) {\n        throw new Error(`ChatGPT Web (Codex) supervisor is already owned by process ${ownerPid}`);\n      }\n      rmSync(path, { force: true });\n    }\n  }\n  throw new Error(\"ChatGPT Web (Codex) supervisor lease could not be acquired\");\n}\n\nexport function tunnelSupervisorLeaseStatus(): {\n  ownedByCurrentProcess: boolean;\n  conflict: boolean;\n  ownerPid?: number;\n} {\n  const path = tunnelClientPaths().supervisorLease;\n  if (!existsSync(path)) return { ownedByCurrentProcess: false, conflict: false };\n  try {\n    const lease = JSON.parse(readFileSync(path, \"utf8\")) as Partial<SupervisorLease>;\n    const ownerPid = Number(lease.pid) || undefined;\n    return {","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/chatgpt-web-codex/tunnelClient.ts#L148-L184","documentation":"Error \"ChatGPT Web (Codex) supervisor is already owned by process ${ownerPid}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/executors/chatgpt-web-codex/tunnelClient.ts:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}