mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
[June 25] handle early output pipe closer (#1402)
This commit is contained in:
@@ -47,6 +47,14 @@ export async function runNonInteractive(
|
|||||||
config: Config,
|
config: Config,
|
||||||
input: string,
|
input: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
// Handle EPIPE errors when the output is piped to a command that closes early.
|
||||||
|
process.stdout.on('error', (err: NodeJS.ErrnoException) => {
|
||||||
|
if (err.code === 'EPIPE') {
|
||||||
|
// Exit gracefully if the pipe is closed.
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const geminiClient = config.getGeminiClient();
|
const geminiClient = config.getGeminiClient();
|
||||||
const toolRegistry: ToolRegistry = await config.getToolRegistry();
|
const toolRegistry: ToolRegistry = await config.getToolRegistry();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user