The selected-project execution path added by #222 can collide with the forked executor IPC descriptor.
spawnWithinWorkspace always places the held directory on fd 3 and only strips NODE_OPTIONS and NODE_PATH. The forked Node executor is launched with stdio: ["ignore", "ignore", "ignore", "ipc"], making NODE_CHANNEL_FD equal to 3. The trampoline Node process can therefore treat the directory fd as its IPC channel before fchdir(3), causing startup failure or an incorrect working directory.
Found while syncing #222 into ClickHouse/ai: https://github.com/ClickHouse/ai/pull/3926#discussion_r4058967763
Suggested direction: reserve a non-conflicting descriptor or explicitly remove/reassign inherited Node IPC state, with an integration test through the actual forked executor.
The selected-project execution path added by #222 can collide with the forked executor IPC descriptor.
spawnWithinWorkspacealways places the held directory on fd 3 and only stripsNODE_OPTIONSandNODE_PATH. The forked Node executor is launched withstdio: ["ignore", "ignore", "ignore", "ipc"], makingNODE_CHANNEL_FDequal to 3. The trampoline Node process can therefore treat the directory fd as its IPC channel beforefchdir(3), causing startup failure or an incorrect working directory.Found while syncing #222 into ClickHouse/ai: https://github.com/ClickHouse/ai/pull/3926#discussion_r4058967763
Suggested direction: reserve a non-conflicting descriptor or explicitly remove/reassign inherited Node IPC state, with an integration test through the actual forked executor.