fix(pi): converge worker failures and thinking state

This commit is contained in:
2026-08-25 11:45:14 +08:00
parent 274187e3cf
commit 61817b161f
28 changed files with 2019 additions and 118 deletions

View File

@@ -119,9 +119,9 @@ describe('locked Pi worker process smoke', () => {
'changed_file',
'runtime_context',
]));
await expect(worker.stop()).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
await expect(worker.stop('test_injection')).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
} finally {
await worker.stop().catch(() => undefined);
await worker.stop('test_injection').catch(() => undefined);
await extension.dispose();
await extensionHost.close();
}
@@ -173,9 +173,9 @@ describe('locked Pi worker process smoke', () => {
});
expect(worker.stderrDiagnostic).not.toContain('Failed to load extension');
expect(await readActiveTools(probe.resultPath)).toEqual(['read', 'grep', 'find', 'ls']);
await expect(worker.stop()).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
await expect(worker.stop('test_injection')).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
} finally {
await worker.stop().catch(() => undefined);
await worker.stop('test_injection').catch(() => undefined);
await extension.dispose();
await extensionHost.close();
}
@@ -235,9 +235,9 @@ describe('locked Pi worker process smoke', () => {
});
expect(await readActiveTools(probe.resultPath)).toEqual(['read', 'grep', 'find', 'ls']);
expect(worker.stderrDiagnostic).not.toContain('Failed to load extension');
await expect(worker.stop()).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
await expect(worker.stop('test_injection')).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
} finally {
await worker.stop().catch(() => undefined);
await worker.stop('test_injection').catch(() => undefined);
await extension.dispose();
await extensionHost.close();
}
@@ -294,9 +294,9 @@ describe('locked Pi worker process smoke', () => {
'runtime_context',
]));
expect(worker.stderrDiagnostic).not.toContain('Failed to load extension');
await expect(worker.stop()).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
await expect(worker.stop('test_injection')).resolves.toMatchObject({ mode: 'stdin-close', code: 0 });
} finally {
await worker.stop().catch(() => undefined);
await worker.stop('test_injection').catch(() => undefined);
await extension.dispose();
await extensionHost.close();
}