feat: add Pi conversation worker pool

This commit is contained in:
2026-08-22 23:21:46 +08:00
parent 161f3f471b
commit 9f55eec9aa
15 changed files with 3600 additions and 0 deletions

View File

@@ -233,12 +233,15 @@ describe('Pi worker process', () => {
it('settles every pending command after an unexpected exit', async () => {
const worker = await makeWorker();
const invalidations: string[] = [];
worker.subscribeInvalidation((error) => invalidations.push(error.code));
const pending = worker.request({ type: 'no_response' });
const crash = worker.request({ type: 'crash' });
await expect(Promise.all([pending, crash])).rejects.toMatchObject({ code: 'PI_RPC_EXITED' });
expect(worker.pendingCommandCount).toBe(0);
expect(worker.generation).toBe(2);
expect(invalidations).toEqual(['PI_RPC_EXITED']);
});
it('keeps only bounded redacted stderr diagnostics', async () => {