mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user