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

@@ -100,6 +100,14 @@ function handle(command) {
if (command.type === 'crash') {
process.exit(7);
}
if (command.type === 'crash_with_stderr') {
const secret = process.env.FAKE_PI_SECRET ?? 'missing-secret';
process.stderr.write(`Authorization: Bearer ${secret}\n`);
process.stderr.write(`token=${secret}\n`);
process.stderr.write(`cwd=${process.cwd()}\n`);
process.stderr.write('worker-exit-marker\n', () => process.exit(9));
return;
}
writeRecord({
type: 'response',
id: command.id,