Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(pi): 孤儿子进程夹具不因 runner 退出后的 EPIPE 退出

david7f7aa3a9505d
diff --git a/packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts b/packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts
index 821665fe3e..c625d2b0bb 100644
--- a/packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts
+++ b/packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts
@@ -403,6 +403,12 @@ fs.appendFileSync(process.env.CINDY_TEST_PI_ARGS, JSON.stringify(process.argv.sl
if (process.env.CINDY_TEST_PI_PIDS) {
fs.appendFileSync(process.env.CINDY_TEST_PI_PIDS, String(process.pid) + '\\n');
}
+${options.surviveStdinEnd
+ // An orphan must outlive its runner's pipes. A prompt already delivered
+ // when the runner dies is still answered; that write fails with EPIPE and,
+ // unhandled, ends this process, so the case would race its own premise.
+ ? "process.stdout.on('error', () => {});\nprocess.stderr.on('error', () => {});"
+ : ''}
if (process.env.CINDY_TEST_PI_TOKENS) {
fs.appendFileSync(process.env.CINDY_TEST_PI_TOKENS, JSON.stringify(process.env.CINDY_PI_SESSION_TOKEN || null) + '\\n');
}