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。

Merge upstream/main into fix/desktop-pending-reply-remount

guyong9adf927c20e1
diff --cc packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts
index 1ece6a644b,454c9b77d0..ca377bdb79
--- a/packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts
+++ b/packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts
@@@ -642,17 -648,16 +648,18 @@@ describe('Cindy durable PI Subagent run
return Number.isSafeInteger(pid) && pid > 0 ? pid : null;
});
try {
- // PID publication precedes the fake child's prompt response. Wait until
- // the real runner has consumed its last startup event before closing the
- // pipes; otherwise the orphan can exit on EPIPE during the inventory scan.
+ // CI #6768: the PID is published before the fake child's prompt output.
+ // Killing the runner in that window can make the child exit on EPIPE,
+ // invalidating the live-orphan premise. Wait until the real runner has
+ // persisted the last startup event, so no output races its pipe closing.
await waitFor(async () => {
const [run] = await listPiSubagentRuns(fixture.root);
- return run?.tasks[0]?.toolUses === 1 ? true : null;
- }, undefined, 'the runner to observe the hanging child after its startup writes');
+ return run?.state === 'running' && run.tasks[0]?.toolUses === 1 ? true : null;
+ }, undefined, 'the runner to receive the hanging child startup output');
fixture.child.kill('SIGTERM');
await waitForClose(fixture.child, fixture.stderr);
+ await waitFor(async () => readFile(fixture.stdinEndedFile, 'utf8').catch(() => null),
+ undefined, 'the orphan to observe stdin closing and remain alive');
const receipt = JSON.parse(await readFile(path.join(fixture.runDir, 'result.json'), 'utf8'));
expect(receipt.state).toBe('stopped');
expect(receipt.tasks[0].status).toBe('stopped');