Skip to content

Commit dc72705

Browse files
fix(source-control): nightly CLI builds again without Cursor Origin's undici import (#33483)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent d411110 commit dc72705

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

  • packages/source-control-cursor-origin/src/server

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

Lines changed: 3 additions & 17 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";
@@ -489,22 +488,9 @@ const make = Effect.gen(function* () {
489488

490489
/**
491490
* 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.
491+
* A keep-alive agent holds idle connections until Origin closes them. Undici would add HTTP/2, but
492+
* the single-executable CLI cannot resolve its static import.
495493
*/
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-
);
494+
const httpClientLayer = NodeHttpClient.layerNodeHttpOptions({ keepAlive: true });
509495

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

0 commit comments

Comments
 (0)