fix(pi): converge worker failures and thinking state
This commit is contained in:
@@ -160,7 +160,7 @@ describe('Pi subagent scheduler', () => {
|
||||
|
||||
it('aborts every unfinished child with the parent and leaves no permit or process lease', async () => {
|
||||
const processBudget = new PiProcessBudget(8);
|
||||
const stopped: string[] = [];
|
||||
const stopped: Array<{ taskId: string; reason: string }> = [];
|
||||
const scheduler = new PiSubagentScheduler({
|
||||
processBudget,
|
||||
openChild: async (input) => ({
|
||||
@@ -173,7 +173,7 @@ describe('Pi subagent scheduler', () => {
|
||||
});
|
||||
return { summary: 'unreachable' };
|
||||
},
|
||||
async stop() { stopped.push(input.taskId); },
|
||||
async stop(reason) { stopped.push({ taskId: input.taskId, reason }); },
|
||||
}),
|
||||
});
|
||||
const controller = new AbortController();
|
||||
@@ -186,6 +186,7 @@ describe('Pi subagent scheduler', () => {
|
||||
const result = await flight;
|
||||
expect(result.details.tasks.map(({ status }) => status)).toEqual(['aborted', 'aborted']);
|
||||
expect(stopped).toHaveLength(2);
|
||||
expect(stopped.map(({ reason }) => reason)).toEqual(['subagent_abort', 'subagent_abort']);
|
||||
expect(processBudget.activeCount).toBe(0);
|
||||
await scheduler.close();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user