fix(coding): close PI-100 review findings

This commit is contained in:
2026-08-23 20:55:49 +08:00
parent 22b4a9f9c4
commit 52b2467d5d
16 changed files with 679 additions and 122 deletions

View File

@@ -25,7 +25,12 @@ import { createPiManagedSubagentChildOpener } from '../coding-runtime/pi/subagen
import { PiSubagentScheduler } from '../coding-runtime/pi/subagent';
import { PiProcessBudget, PiWorkerPool } from '../coding-runtime/pi/worker-pool';
import { getProviderService } from '../services/providers/provider-service';
import {
isCodingProviderAuthenticationError,
refreshCodingProviderCredential,
} from './coding-provider-auth';
import { createCodingProductHost, type CodingProductComposition } from './coding-product-services';
import { archivePiConversationSession } from '../coding-runtime/pi/resource-loader';
export interface CodingCompositionPaths {
executablePath: string;
@@ -128,6 +133,8 @@ export function createCodingComposition(
buildPiProviderCatalog(await loadProviderInput()),
model,
),
isAuthenticationError: isCodingProviderAuthenticationError,
refreshCredential: refreshCodingProviderCredential,
resolveImages: async (refs) => await Promise.all(refs.map(async ({ attachmentId }) => {
const record = await attachments.read(attachmentId);
return {
@@ -155,7 +162,15 @@ export function createCodingComposition(
]);
},
});
const conversations = new CodingConversationService(projects, runtime);
const conversations = new CodingConversationService(projects, runtime, {
archiveSession: async ({ projectId, sessionKey }) => {
await archivePiConversationSession({
userDataDir: options.paths.userDataDir,
projectId,
sessionKey,
});
},
});
const host = createCodingProductHost({
projects,
productTools,