Environment
- Version: 2026.4.15
- OS: Linux
- Install Method: script
Description
The CodexAppServerClient communicates with the codex-acp subprocess over stdio. If the subprocess encounters an initialization failure (for instance, an interactive prompt emitted to stdout, or a deprecated config file throwing an error string), the subprocess writes plaintext text to stdout and then abruptly exits.
Currently, CodexAppServerClient.handleLine attempts to JSON.parse() this stdout text, fails, and catches the parsing error. When the child process exits immediately after (closing its pipe), OpenClaw subsequently attempts to write the JSON-RPC initialize payload to the deceased subprocess's stdin. Because no error listener is attached to the stdin stream, Node.js throws an unhandled write EPIPE exception, which cascades to immediately terminate the entire OpenClaw gateway daemon.
Expected Behavior
A misconfigured or failing child plugin subprocess should fail gracefully without taking down the entire OpenClaw gateway daemon.
Proposed Fix
Attach an error event handler to child.stdin to swallow expected pipe lifecycle tear-down errors:
if (child.stdin) {
child.stdin.on('error', (err) => {
if (err.code !== 'EPIPE') {
log.debug('codex app-server stdin error', { err });
}
});
}
Environment
Description
The
CodexAppServerClientcommunicates with thecodex-acpsubprocess overstdio. If the subprocess encounters an initialization failure (for instance, an interactive prompt emitted to stdout, or a deprecated config file throwing an error string), the subprocess writes plaintext text tostdoutand then abruptly exits.Currently,
CodexAppServerClient.handleLineattempts toJSON.parse()this stdout text, fails, and catches the parsing error. When the child process exits immediately after (closing its pipe), OpenClaw subsequently attempts to write the JSON-RPC initialize payload to the deceased subprocess'sstdin. Because noerrorlistener is attached to thestdinstream, Node.js throws an unhandledwrite EPIPEexception, which cascades to immediately terminate the entire OpenClaw gateway daemon.Expected Behavior
A misconfigured or failing child plugin subprocess should fail gracefully without taking down the entire OpenClaw gateway daemon.
Proposed Fix
Attach an
errorevent handler tochild.stdinto swallow expected pipe lifecycle tear-down errors: