Skip to content

Commit f5b1be3

Browse files
krissdingclaude
andcommitted
fix(acp): attach error listener to spawned ACP agent process
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 <[email protected]>
1 parent 3e83878 commit f5b1be3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/acp/client.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpClientHa
147147
throw new Error("Failed to create ACP stdio pipes");
148148
}
149149

150+
agent.on("error", (err) => {
151+
log(`agent error: ${String(err)}`);
152+
});
153+
150154
const input = Writable.toWeb(agent.stdin);
151155
const output = Readable.toWeb(agent.stdout) as unknown as ReadableStream<Uint8Array>;
152156
const stream = ndJsonStream(input, output);

0 commit comments

Comments
 (0)