Skip to content

Commit 30eefa0

Browse files
fix(fork): the t3 CLI executable builds with Cursor Origin
Upstream's Cursor Origin client (pingdotgg#33093) imports undici through ESM, which the single-executable CLI cannot load, so every Cody build failed packaging the server. Origin now uses Node's http client with keep-alive. It loses HTTP/2, nothing else.
1 parent 4f84ecf commit 30eefa0

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

‎.agents/skills/personal-fork/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ These come from earlier syncs. Each run starts in a fresh thread, so anything le
163163
- Quote in thread, Keep as thread, and Delete all are planned for a later release.
164164
- Side chats start with the parent composer's permission mode and model since #32315, through `useSideChat`'s required `readSettings`. Cody's palette entry and Ask in side chat run outside ChatView, so they pass `readParentComposerSettings` (`apps/web/src/cody/sideChatSettings.ts`), which follows ChatView's `composerSelectedModelSelection ?? thread` fallback. The daily workflow merged #32315 without them, and only the web typecheck caught it.
165165
- Upstream's Labs "hide tool calls" view (`toolCallVisibility: "zen"`, #30000) skips turn folds and shows only each run's last reply. Cody adds the answer before a short wrap-up to that set too: `timelineRowEntries` in web `MessagesTimeline.logic.ts` and `zenAnswerMessageIds` in mobile `threadActivity.ts`. The wrap-up tests in both test files check the zen view as well.
166+
- The CLI executable fails with `ServerCliExecutableImportError ... undici` when server code reaches undici through ESM, such as `@effect/platform-node/Undici` or `NodeHttpClient.layerUndici*` (undici stays external for the Cursor SDK). Upstream's Cursor Origin (#33093) did this before upstream released it; Cody's `OriginCli.ts` uses `layerNodeHttpOptions` instead. Reproduce with Node 26.12.1 on `PATH`: `node apps/server/scripts/cli.ts build-exe`. Drop Cody's change once upstream fixes it its own way.
166167
- Building Windows on a Windows host adds about 16 files to upstream's cross-built payload (prepared server compile cache, node-pty's `build/Release`, a second resource monitor copy, the sign-in helper), so Cody raises `WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT` from upstream's 80 to 96. When x64 fails with "Windows packaged payload contains N files", compare the 7-Zip `+` file lists of Cody's and upstream's Windows x64 jobs before raising it again. Transcription's 13 x64-only DLLs (#30625) are what pushed it over 80.
167168
- `scripts/build-desktop-artifact.test.ts` keeps a packaging test upstream pruned. Update its expectations when upstream changes `createBuildConfig` (mac and Linux unpack `@transcribe-cpp` libraries since #30625).
168169
- `buildRuntimeInstructions` has two returns since Antigravity skips PR linking (#28629). Cody's `<final_answer>` block sits inside `runtimeInfo` so both carry it.

‎packages/source-control-cursor-origin/src/server/OriginCli.ts‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import * as Schema from "effect/Schema";
1414
import * as Semaphore from "effect/Semaphore";
1515
import { HttpClient, HttpClientRequest } from "effect/http";
1616
import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient";
17-
import { Agent } from "@effect/platform-node/Undici";
1817
import { collectUint8StreamText } from "@t3tools/provider-core/server/collectStreamText";
1918
import { decodeJsonResult } from "@t3tools/shared/schemaJson";
2019
import { parseGitRemoteHost } from "@t3tools/source-control-core/shared/definition";
@@ -488,23 +487,9 @@ const make = Effect.gen(function* () {
488487
});
489488

490489
/**
491-
* Origin answers from a few hundred milliseconds away, so a new TLS connection doubles a request.
492-
* Undici's default drops an idle connection after four seconds, which a person reading a pull
493-
* request always outlasts; Origin keeps one open for minutes, and HTTP/2 carries a detail's
494-
* parallel reads on it at once.
490+
* Origin answers from a few hundred milliseconds away, so idle connections stay open for reuse.
491+
* Cody: node:http, not undici. The CLI executable cannot load undici through an ESM import.
495492
*/
496-
const httpClientLayer = NodeHttpClient.layerUndiciNoDispatcher.pipe(
497-
Layer.provide(
498-
Layer.effect(NodeHttpClient.Dispatcher)(
499-
Effect.acquireRelease(
500-
Effect.sync(
501-
() =>
502-
new Agent({ allowH2: true, keepAliveTimeout: 300_000, keepAliveMaxTimeout: 300_000 }),
503-
),
504-
(agent) => Effect.promise(() => agent.destroy()),
505-
),
506-
),
507-
),
508-
);
493+
const httpClientLayer = NodeHttpClient.layerNodeHttpOptions({ keepAlive: true });
509494

510495
export const layer = Layer.effect(OriginCli, make).pipe(Layer.provide(httpClientLayer));

0 commit comments

Comments
 (0)