fix: preserve Pi projection continuity
This commit is contained in:
@@ -203,6 +203,12 @@ describe('Pi Conversation runtime', () => {
|
||||
},
|
||||
});
|
||||
await Promise.all(inputs.slice(0, 2).map((input) => runtime.prepare(input)));
|
||||
const leftGenerationOneSeqs: number[] = [];
|
||||
const unsubscribe = runtime.subscribe((envelope) => {
|
||||
if (envelope.conversationId === left.id && envelope.workerGeneration === 1) {
|
||||
leftGenerationOneSeqs.push(envelope.seq);
|
||||
}
|
||||
});
|
||||
|
||||
const releasePromptAcceptance = workers.get(left.id)!.holdNext('prompt');
|
||||
let acceptanceResolved = false;
|
||||
@@ -280,6 +286,8 @@ describe('Pi Conversation runtime', () => {
|
||||
expect((await runtime.getSnapshot(left.id)).run.status).toBe('idle');
|
||||
const settledNodes = (await runtime.getSnapshot(left.id)).nodes;
|
||||
expect(settledNodes).toEqual(checkpoint.nodes);
|
||||
expect(leftGenerationOneSeqs).toEqual(leftGenerationOneSeqs.map((_, index) => index + 1));
|
||||
expect((await runtime.getSnapshot(left.id)).cursor.seq).toBe(leftGenerationOneSeqs.at(-1));
|
||||
|
||||
const changed = await runtime.setModel({
|
||||
conversationId: left.id,
|
||||
@@ -452,5 +460,6 @@ describe('Pi Conversation runtime', () => {
|
||||
await expect(runtime.getSnapshot(forkTarget.id)).rejects.toMatchObject({
|
||||
publicError: { code: 'CODING_CONVERSATION_NOT_FOUND' },
|
||||
});
|
||||
unsubscribe();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user