feat: add Pi conversation worker pool

This commit is contained in:
2026-08-22 23:21:46 +08:00
parent 161f3f471b
commit 9f55eec9aa
15 changed files with 3600 additions and 0 deletions

View File

@@ -213,6 +213,28 @@ export function createCodingConversationStore(
});
},
async setModelState(
conversationId: string,
modelState: ConversationModelState,
): Promise<CodingConversationV2> {
return await mutate(async (file) => {
const current = file.conversations.find((item) => item.id === conversationId);
if (!current) throw new Error('Conversation does not exist');
const updated = normalizeConversation({
...current,
...modelState,
updatedAt: now(),
});
return {
result: updated,
file: {
schemaVersion: 2,
conversations: file.conversations.map((item) => item.id === conversationId ? updated : item),
},
};
});
},
async ensureSessionBinding(
conversationId: string,
createBinding: () => Promise<PiSessionBinding>,