chore(integration): snapshot local main worktree

This commit is contained in:
inman
2026-08-31 10:23:21 +08:00
parent 48a9189939
commit 33fb31fb28
116 changed files with 8108 additions and 3026 deletions

View File

@@ -296,6 +296,11 @@ describe('Pi Conversation runtime', () => {
}
});
const beforeNoopPrepare = await runtime.getSnapshot(left.id);
await runtime.prepare(inputs[0]!);
expect(await runtime.getSnapshot(left.id)).toEqual(beforeNoopPrepare);
expect(leftGenerationOneSeqs).toEqual([]);
const releasePromptAcceptance = workers.get(left.id)!.holdNext('prompt');
let acceptanceResolved = false;
const acceptance = runtime.prompt({
@@ -343,8 +348,8 @@ describe('Pi Conversation runtime', () => {
expect(workers.get(left.id)!.requests.at(-1)).toEqual({
type: 'extension_ui_response', id: 'question-runtime', value: 'Small seam',
});
expect((await runtime.getSnapshot(left.id)).pendingInteractions).toContainEqual(
expect.objectContaining({ id: 'question-runtime', status: 'answered' }),
expect((await runtime.getSnapshot(left.id)).pendingInteractions).not.toContainEqual(
expect.objectContaining({ id: 'question-runtime' }),
);
const durable = {
state: {
@@ -697,7 +702,11 @@ describe('Pi Conversation runtime', () => {
expect(activeBackgroundLeases).toBe(0);
expect((await runtime.getSnapshot(left.id)).run).toMatchObject({
terminalReason: 'failed',
error: { code: 'CODING_RUNTIME_PROTOCOL_ERROR', recoverable: true },
error: {
code: 'CODING_RUNTIME_PROTOCOL_ERROR',
message: '本地 Agent 通信异常,当前对话已停止。',
recoverable: true,
},
});
workers.get(left.id)!.emit({ type: 'agent_settled' });
await new Promise((resolve) => setImmediate(resolve));