{"record":{"id":"90971ab388e55253","repo":"diegosouzapw/OmniRoute","slug":"blackbox-auth-required","errorCode":"BLACKBOX_AUTH_REQUIRED","errorMessage":"Blackbox session is not authenticated — re-paste next-auth.session-token from app.blackbox.ai","messagePattern":"Blackbox session is not authenticated — re-paste next-auth\\.session-token from app\\.blackbox\\.ai","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"open-sse/executors/blackbox-web.ts","lineNumber":626,"sourceCode":"              \"If you have a paid plan, re-paste your session cookie from app.blackbox.ai.\",\n            type: \"upstream_error\",\n            code: \"BLACKBOX_SUBSCRIPTION_REQUIRED\",\n          },\n        }),\n        { status: 402, headers: { \"Content-Type\": \"application/json\" } }\n      );\n      return { response: errorResponse, url: BLACKBOX_CHAT_API, headers, transformedBody };\n    }\n\n    if (isAuthError) {\n      log?.warn?.(\"BLACKBOX-WEB\", \"Blackbox returned auth error in response body\");\n      const errorResponse = new Response(\n        JSON.stringify({\n          error: {\n            message:\n              \"Blackbox session is not authenticated — re-paste next-auth.session-token from app.blackbox.ai\",\n            type: \"upstream_error\",\n            code: \"BLACKBOX_AUTH_REQUIRED\",\n          },\n        }),\n        { status: 401, headers: { \"Content-Type\": \"application/json\" } }\n      );\n      return { response: errorResponse, url: BLACKBOX_CHAT_API, headers, transformedBody };\n    }\n\n    if (isRateLimit) {\n      log?.warn?.(\"BLACKBOX-WEB\", \"Blackbox returned rate-limit error in response body\");\n      const errorResponse = new Response(\n        JSON.stringify({\n          error: {\n            message: \"Blackbox Web rate limited the session. Wait a moment and retry.\",\n            type: \"upstream_error\",\n            code: \"BLACKBOX_RATE_LIMIT\",\n          },\n        }),\n        { status: 429, headers: { \"Content-Type\": \"application/json\" } }","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/blackbox-web.ts#L608-L644","documentation":"The Blackbox web executor detected authentication-required phrases in the upstream body (and explicitly not a subscription error). The next-auth.session-token cookie is missing, expired, or invalid, so the executor returns 401 with BLACKBOX_AUTH_REQUIRED instead of forwarding a doomed request.","triggerScenarios":"Thrown at open-sse/executors/blackbox-web.ts:626 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log in to app.blackbox.ai and re-paste the next-auth.session-token cookie into the connection","Delete and recreate the connection if the cookie field is corrupted","Verify the cookie was copied fully (it is a long JWT) and has not expired"],"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"}