Skip to content

Commit 4533dd0

Browse files
fix(server): every server spawn goes through the non-blocking spawner
NodeHttpServer.layer also outputs NodeServices, so the runtime services and provider drivers resolved the native spawner from the HTTP layer, and ProcessRunner was first built from the CLI's native NodeServices. Git and codex app-server still received the project cwd natively. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e82895b commit 4533dd0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎apps/server/src/server.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,11 @@ const layerHttpServer = Layer.unwrap(
372372
},
373373
);
374374
}),
375-
).pipe(Layer.provide(ManagedPolicy.layer));
375+
).pipe(
376+
Layer.provide(ManagedPolicy.layer),
377+
// NodeHttpServer.layer also outputs NodeServices; keep its native spawner out of the server.
378+
(layer) => NonBlockingSpawner.layer.pipe(Layer.provideMerge(layer)),
379+
);
376380

377381
const layerPlatformServices = DocumentText.layer.pipe(
378382
Layer.provideMerge(NonBlockingSpawner.layer),
@@ -1199,6 +1203,7 @@ const layerMakeServer = Layer.unwrap(
11991203
Layer.provideMerge(layerPlatformServices),
12001204
);
12011205
}),
1202-
).pipe(Layer.provide(ProcessRunner.layer));
1206+
// ProcessRunner.layer is memoized, so this first build is the one every provide reuses.
1207+
).pipe(Layer.provide(ProcessRunner.layer.pipe(Layer.provide(NonBlockingSpawner.layer))));
12031208

12041209
export const runServer = Layer.launch(layerMakeServer);

0 commit comments

Comments
 (0)