diegosouzapw/OmniRoute · error · Error

Could not create HyperAgent thread (HTTP ${res2.status}). En

Error message

Could not create HyperAgent thread (HTTP ${res2.status}). Ensure the session Cookie is valid and not expired.

What it means

Error "Could not create HyperAgent thread (HTTP ${res2.status}). Ensure the session Cookie is valid and not expired." thrown in diegosouzapw/OmniRoute.

Source

Thrown at open-sse/executors/hyperagent.ts:572

    }),
    signal: signal ?? undefined,
    redirect: "manual",
  });
  const loc2 =
    res2.headers.get("location") ||
    res2.headers.get("Location") ||
    res2.headers.get("x-middleware-rewrite") ||
    "";
  const fromLoc2 = extractThreadIdFromUrl(loc2);
  if (fromLoc2) return fromLoc2;

  if (res2.status >= 200 && res2.status < 400) {
    const text = await res2.text().catch(() => "");
    const m = text.match(/\/thread\/(cm[a-z0-9]{20,})/i) || text.match(/"(cm[a-z0-9]{20,})"/i);
    if (m) return m[1]!;
  }

  throw new Error(
    `Could not create HyperAgent thread (HTTP ${res2.status}). Ensure the session Cookie is valid and not expired.`
  );
}

/**
 * Apply model + execution settings on a thread (live SPA does this before chat).
 *
 * - modelId: wire id (e.g. fable-latest — NOT bare "fable")
 * - defaultSubagentModel: short family (fable|opus|sonnet|haiku) matching selected model
 * - executionMode: "auto" (only non-null value accepted live)
 * - runtimeId: claude-agents-sdk for Claude family
 *
 * Chat body must NOT carry modelId (API returns model_unknown for bare pricing keys).
 */
export async function configureHyperAgentThread(
  cookie: string,
  threadId: string,
  opts: {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at open-sse/executors/hyperagent.ts:572 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/fb1f0bc7eda4c57e. Report an issue: GitHub.