{"record":{"id":"4e8e798979ad673d","repo":"diegosouzapw/OmniRoute","slug":"chatgpt-browser-validation-reference-is-invalid","errorCode":null,"errorMessage":"ChatGPT browser validation reference is invalid","messagePattern":"ChatGPT browser validation reference is invalid","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/chatgpt-web-codex/storageState.ts","lineNumber":163,"sourceCode":"        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,\n    storageState,\n    ...(runtimeKey ? { runtimeKey } : {}),","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/chatgpt-web-codex/storageState.ts#L145-L181","documentation":"Guard in finalizeValidatedChatGptWebCodexSecrets: the validationId does not match /^validation-[a-f0-9]{24}$/. The input at fault is the caller-supplied reference — it is malformed, truncated, or from a different validation scheme, so the corresponding runtime state cannot be located.","triggerScenarios":"Thrown at open-sse/executors/chatgpt-web-codex/storageState.ts:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the validation id exactly as returned when the browser validation was started","Do not alter or reformat the validation-<24 hex> identifier between starting and finalizing","Restart validation to obtain a fresh, well-formed id"],"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"}