@@ -14,7 +14,6 @@ import * as Schema from "effect/Schema";
1414import * as Semaphore from "effect/Semaphore" ;
1515import { HttpClient , HttpClientRequest } from "effect/http" ;
1616import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient" ;
17- import { Agent } from "@effect/platform-node/Undici" ;
1817import { collectUint8StreamText } from "@t3tools/provider-core/server/collectStreamText" ;
1918import { decodeJsonResult } from "@t3tools/shared/schemaJson" ;
2019import { 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
510496export const layer = Layer . effect ( OriginCli , make ) . pipe ( Layer . provide ( httpClientLayer ) ) ;
0 commit comments