{"record":{"id":"3250802020d1a684","repo":"diegosouzapw/OmniRoute","slug":"clerk-v1-client-returned-http-resp-status-ch","errorCode":null,"errorMessage":"Clerk /v1/client returned HTTP ${resp.status} — check your __client cookie","messagePattern":"Clerk /v1/client returned HTTP (.+?) — check your __client cookie","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/adapta-web.ts","lineNumber":105,"sourceCode":"// ── Clerk auth flow ───────────────────────────────────────────────────────────\n\n/** Step 1: GET /v1/client → returns active session ID. */\nasync function getSessionId(\n  clientJwt: string,\n  signal?: AbortSignal | null,\n  log?: ExecuteInput[\"log\"]\n): Promise<string> {\n  const resp = await fetch(`${ADAPTA_CLERK_URL}/v1/client`, {\n    headers: {\n      Cookie: `__client=${clientJwt}`,\n      \"User-Agent\": USER_AGENT,\n      Origin: ADAPTA_APP_URL,\n    },\n    signal: signal ?? undefined,\n  });\n\n  if (!resp.ok) {\n    throw new Error(`Clerk /v1/client returned HTTP ${resp.status} — check your __client cookie`);\n  }\n\n  const body = await resp.json();\n  const sessions: Array<{ id: string; status: string }> = body?.response?.sessions ?? [];\n  const active = sessions.find((s) => s.status === \"active\");\n  if (!active?.id) {\n    throw new Error(\n      \"No active Clerk session found — your __client cookie may be expired or invalid\"\n    );\n  }\n\n  log?.info?.(\"ADAPTA-WEB\", `Got session ID: ${active.id}`);\n  return active.id;\n}\n\n/** Step 2: POST /v1/client/sessions/{id}/tokens → fresh short-lived JWT. */\nasync function refreshSessionJwt(\n  clientJwt: string,","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/adapta-web.ts#L87-L123","documentation":"Error \"Clerk /v1/client returned HTTP ${resp.status} — check your __client cookie\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/executors/adapta-web.ts:105 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"}