Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **fix(build):** keep `node:fs`/`node:os`/`node:path` out of the client chunk graph for `/dashboard/logs` — a further, previously-undiscovered edge (`src/lib/oauth/constants/oauth.ts` importing `cursorAgentCliVersion.ts`, reachable from 250+ dashboard pages) of the same root cause already fixed in #13436/#13509/#13568. Moves the pinned CLI version string into a new import-free leaf module and extends the `client-bundle-no-server-only-10692` guard test to cover it ([#13604](https://github.com/diegosouzapw/OmniRoute/pull/13604)).
7 changes: 2 additions & 5 deletions open-sse/utils/cursorAgentCliVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ import {
} from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { CURSOR_AGENT_CLI_VERSION } from "./cursorAgentCliVersionPin.ts";

/**
* Pinned Agent CLI build id used when no local install is found (typical
* headless OmniRoute). Bump when refreshing Cursor CLI impersonation.
*/
export const CURSOR_AGENT_CLI_VERSION = "2026.07.08-0c04a8a";
export { CURSOR_AGENT_CLI_VERSION };

const VERSION_ID_RE = /^\d{4}\.\d{2}\.\d{2}-[0-9a-f]+$/;
const CACHE_TTL_MS = 60 * 60 * 1000;
Expand Down
14 changes: 14 additions & 0 deletions open-sse/utils/cursorAgentCliVersionPin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Pinned Agent CLI build id used when no local install is found (typical
* headless OmniRoute). Bump when refreshing Cursor CLI impersonation.
*
* Deliberately import-free: cursorAgentCliVersion.ts (the full resolver:
* env → local install detect → disk-cached installer scrape → this pin)
* pulls in `node:fs`/`node:os`/`node:path`. Any client-reachable file that
* only needs the pin string -- not the full resolver -- must import it from
* here instead, or Turbopack/webpack chokes trying to bundle those Node
* builtins into the browser build ("the chunking context does not support
* external modules"). See #13436/#13509/#13568 for the same cut applied to
* other edges reaching this same resolver.
*/
export const CURSOR_AGENT_CLI_VERSION = "2026.07.08-0c04a8a";
4 changes: 2 additions & 2 deletions src/lib/oauth/constants/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
GROK_BUILD_TOKEN_URL,
} from "@omniroute/open-sse/config/grokBuild.ts";
import { resolvePublicCred } from "@omniroute/open-sse/utils/publicCreds.ts";
import { CURSOR_AGENT_CLI_VERSION } from "@omniroute/open-sse/utils/cursorAgentCliVersion.ts";
import { CURSOR_AGENT_CLI_VERSION } from "@omniroute/open-sse/utils/cursorAgentCliVersionPin.ts";
import { buildGitLabOAuthEndpoints, GITLAB_DUO_DEFAULT_BASE_URL } from "../gitlab";

/**
Expand Down Expand Up @@ -381,7 +381,7 @@ export const KIRO_CONFIG = {
// Cursor stores credentials in SQLite database: state.vscdb
// Keys: cursorAuth/accessToken, cursorAuth/refreshToken, storage.serviceMachineId
// Deep-control PKCE + refresh aligned with OpenCodex (lidge-jun/opencodex src/oauth/cursor.ts).
// clientVersion pin lives in open-sse/utils/cursorAgentCliVersion.ts — single source of truth.
// clientVersion pin lives in open-sse/utils/cursorAgentCliVersionPin.ts — single source of truth.
export const CURSOR_CONFIG = {
// API endpoints
apiEndpoint: "https://api2.cursor.sh",
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/client-bundle-no-server-only-10692.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ const SERVER_ONLY = new Set([
"src/lib/db/migrationRunner.ts",
"open-sse/utils/proxyFetch.ts",
"open-sse/utils/tlsClient.ts",
// fs/os/path resolver behind CURSOR_AGENT_CLI_VERSION; the pin string alone
// lives in the import-free cursorAgentCliVersionPin.ts (single source of
// truth) precisely so client-reachable code can depend on the value
// without dragging this file in. Turbopack panic reproduced live via
// `open-sse/config/providerModels.ts` -> ... -> `src/lib/oauth/constants/oauth.ts`
// -> here, reached from /dashboard/logs.
"open-sse/utils/cursorAgentCliVersion.ts",
]);

/**
Expand Down
Loading