fix(acp): attach error listener to spawned ACP agent process (#109529)

The spawned agent child process in createAcpClient had no error
listener. If the agent binary failed to start, the error event
would be unhandled and could crash the process.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
krissding
2026-07-29 18:40:34 +08:00
committed by GitHub
parent 1f4f1bbc33
commit ee820b185c
+4
View File
@@ -147,6 +147,10 @@ async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpClientHa
throw new Error("Failed to create ACP stdio pipes");
}
agent.on("error", (err) => {
log(`agent error: ${String(err)}`);
});
const input = Writable.toWeb(agent.stdin);
const output = Readable.toWeb(agent.stdout) as unknown as ReadableStream<Uint8Array>;
const stream = ndJsonStream(input, output);