fix(pi): settle delayed compact ownership
This commit is contained in:
@@ -117,6 +117,12 @@ export type PiWorkerPoolEvent =
|
||||
generation: number;
|
||||
runId: string;
|
||||
}
|
||||
| {
|
||||
type: 'top-level.settled';
|
||||
conversationId: string;
|
||||
generation: number;
|
||||
runId: string;
|
||||
}
|
||||
| {
|
||||
type: 'top-level.failed';
|
||||
conversationId: string;
|
||||
@@ -756,6 +762,15 @@ export class PiWorkerPool {
|
||||
onLateResult: (result) => this.handleLateTopLevelResult(current!, run, result),
|
||||
});
|
||||
this.confirmTopLevel(current, run);
|
||||
if (run.command.type === 'compact') {
|
||||
this.settleTopLevel(current);
|
||||
this.emit({
|
||||
type: 'top-level.settled',
|
||||
conversationId: run.conversationId,
|
||||
generation: current.generation,
|
||||
runId: run.runId,
|
||||
});
|
||||
}
|
||||
run.resolve(response);
|
||||
} catch (error) {
|
||||
const active = this.activeRuns.get(run.conversationId);
|
||||
@@ -823,6 +838,15 @@ export class PiWorkerPool {
|
||||
generation: record.generation,
|
||||
runId: run.runId,
|
||||
});
|
||||
if (run.command.type === 'compact') {
|
||||
this.settleTopLevel(record);
|
||||
this.emit({
|
||||
type: 'top-level.settled',
|
||||
conversationId: run.conversationId,
|
||||
generation: record.generation,
|
||||
runId: run.runId,
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (result.error.code === 'PI_RPC_EXITED'
|
||||
|
||||
Reference in New Issue
Block a user