{"record":{"id":"f717431aeee16ac2","repo":"diegosouzapw/OmniRoute","slug":"a-fresh-chatgpt-cookie-is-required-for-browser-val","errorCode":null,"errorMessage":"A fresh ChatGPT Cookie is required for browser validation","messagePattern":"A fresh ChatGPT Cookie is required for browser validation","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/chatgpt-web-codex/storageState.ts","lineNumber":161,"sourceCode":"        authenticated: true,\n        verifiedAt: new Date().toISOString(),\n        storageStateFingerprint: fingerprint,\n        pendingBrowserVerification: false,\n      })}\\n`\n    );\n    return paths.storageStatePath;\n  }\n  if (!credential.cookie) throw new Error(\"ChatGPT browser credentials are missing\");\n  return ensureConnectionStorageState(connectionId, credential.cookie);\n}\n\nexport function finalizeValidatedChatGptWebCodexSecrets(\n  encodedCredential: string,\n  validationId: string\n): { encodedCredential: string; storageState: Record<string, unknown> } {\n  const parsed = JSON.parse(encodedCredential) as Record<string, unknown>;\n  const rawCookie = typeof parsed.cookie === \"string\" ? cookieHeaderValue(parsed.cookie) : \"\";\n  if (!rawCookie) throw new Error(\"A fresh ChatGPT Cookie is required for browser validation\");\n  if (!/^validation-[a-f0-9]{24}$/.test(validationId)) {\n    throw new Error(\"ChatGPT browser validation reference is invalid\");\n  }\n  const paths = connectionRuntimePaths(validationId);\n  const markerPath = loginVerificationMarkerPath(paths.storageStatePath);\n  const marker = JSON.parse(readFileSync(markerPath, \"utf8\")) as Record<string, unknown>;\n  if (\n    marker.version !== 1 ||\n    marker.authenticated !== true ||\n    marker.pendingBrowserVerification === true ||\n    marker.cookieFingerprint !== cookieFingerprint(rawCookie)\n  ) {\n    throw new Error(\"ChatGPT browser validation does not match the supplied Cookie\");\n  }\n  const storageState = readConnectionStorageState(paths.storageStatePath);\n  const runtimeKey = typeof parsed.runtimeKey === \"string\" ? parsed.runtimeKey.trim() : \"\";\n  const next = JSON.stringify({\n    version: 2,","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/chatgpt-web-codex/storageState.ts#L143-L179","documentation":"Guard in finalizeValidatedChatGptWebCodexSecrets: the supplied encoded credential contains no cookie string. Finalizing a browser validation requires the exact fresh cookie that started the validation (its fingerprint must match the one captured by the browser), so a credential without one cannot be matched to the validation run.","triggerScenarios":"Thrown at open-sse/executors/chatgpt-web-codex/storageState.ts:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Submit the same fresh ChatGPT cookie that initiated the browser validation when finalizing","Restart the validation flow from a newly copied cookie"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}