{"record":{"id":"14321a21dcc1ce8b","repo":"diegosouzapw/OmniRoute","slug":"sentinel-chat-requirements-blocked-http-crresp","errorCode":null,"errorMessage":"Sentinel /chat-requirements blocked (HTTP ${crResp.status})","messagePattern":"Sentinel /chat-requirements blocked \\(HTTP (.+?)\\)","errorType":"exception","errorClass":"SentinelBlockedError","httpStatus":403,"severity":"error","filePath":"open-sse/executors/chatgpt-web.ts","lineNumber":484,"sourceCode":"    /* keep empty */\n  }\n  // Stage 2: POST /chat-requirements with the prepare_token in the body. This\n  // is the call that actually returns the chat-requirements-token used on the\n  // conversation request.\n  if (!prepData.prepare_token) {\n    return prepData; // pass through whatever we got — caller handles missing fields\n  }\n\n  const crBody: Record<string, unknown> = { p: prekey, prepare_token: prepData.prepare_token };\n  const crResp = await tlsFetchChatGpt(SENTINEL_CR_URL, {\n    method: \"POST\",\n    headers,\n    body: JSON.stringify(crBody),\n    timeoutMs: 30_000,\n    signal,\n  });\n  if (crResp.status === 401 || crResp.status === 403) {\n    throw new SentinelBlockedError(`Sentinel /chat-requirements blocked (HTTP ${crResp.status})`);\n  }\n  if (crResp.status >= 400) {\n    // Fall back to whatever /prepare returned — some accounts may not need stage 2.\n    return prepData;\n  }\n  try {\n    const crData = JSON.parse(crResp.text || \"{}\") as ChatRequirements;\n    // Merge: prepare_token from stage 1, everything else from stage 2.\n    return { ...crData, prepare_token: prepData.prepare_token };\n  } catch {\n    console.warn(\"[chatgpt-web] chat requirements response JSON parse failed\");\n    return prepData;\n  }\n}\n\nclass SentinelBlockedError extends Error {\n  constructor(message: string) {\n    super(message);","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/chatgpt-web.ts#L466-L502","documentation":"Sentinel stage-2 guard (SentinelBlockedError): POST /chat-requirements with the prepare_token returned 401/403. The prepare token was accepted-shaped but the final chat-requirements call got blocked — the anti-bot layer rejected the session mid-handshake, so no chat-requirements token can be obtained for the conversation.","triggerScenarios":"Thrown at open-sse/executors/chatgpt-web.ts:484 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the session cookie and retry the conversation","Slow down or pause chatgpt-web usage to let Sentinel scoring recover","Complete account verification in a browser, then re-save the credential","Use an API-based provider as fallback while the web session is blocked"],"exampleFix":null,"handlingStrategy":"fallback","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"}