fix: close PI core chat review gaps

This commit is contained in:
2026-08-24 01:28:06 +08:00
parent 612135f911
commit bec93d0918
15 changed files with 1094 additions and 122 deletions

View File

@@ -81,7 +81,18 @@ export function createCodingComposition(
});
const extensionHost = new PiManagedExtensionHost();
extensionHost.configureProductTools(productTools);
const registry = new PiSessionRegistry({ projectStore });
const conversationStores = new Map<string, ReturnType<typeof createCodingConversationStore>>();
const conversationStoreForProject = (projectPath: string) => {
const existing = conversationStores.get(projectPath);
if (existing) return existing;
const created = createCodingConversationStore(projectPath);
conversationStores.set(projectPath, created);
return created;
};
const registry = new PiSessionRegistry({
projectStore,
createConversationStore: conversationStoreForProject,
});
const revisions = new PiManagedInputRevisionCoordinator();
const processBudget = new PiProcessBudget();
const loadProviderInput = async () => ({
@@ -145,15 +156,16 @@ export function createCodingComposition(
})),
});
const projects = new CodingProjectService(projectStore, {
createConversationStore: conversationStoreForProject,
onResourcesChanged: async (project) => {
runtime.markResourcesStale();
const conversations = await createCodingConversationStore(project.path).read()
const conversations = await conversationStoreForProject(project.path).read()
.then((file) => file.conversations)
.catch(() => []);
for (const conversation of conversations) registry.forget(conversation.id);
},
onProjectDeactivated: async (project) => {
const conversations = await createCodingConversationStore(project.path).read()
const conversations = await conversationStoreForProject(project.path).read()
.then((file) => file.conversations)
.catch(() => []);
await Promise.allSettled([