feat: add Pi conversation worker pool
This commit is contained in:
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user