fix(pi): resolve packaged proxy token lazily
This commit is contained in:
@@ -46,7 +46,7 @@ export interface CreateCodingCompositionOptions {
|
||||
projectStore?: CodingProjectStore;
|
||||
browser: AgentBrowserModule;
|
||||
paths: CodingCompositionPaths;
|
||||
localProxyCredential?: string;
|
||||
getLocalProxyCredential?(): string | undefined;
|
||||
}
|
||||
|
||||
export function resolveCodingPiRuntimePaths(input: {
|
||||
@@ -73,6 +73,7 @@ export function resolveCodingPiRuntimePaths(input: {
|
||||
export function createCodingComposition(
|
||||
options: CreateCodingCompositionOptions,
|
||||
): CodingProductComposition {
|
||||
const getLocalProxyCredential = options.getLocalProxyCredential;
|
||||
const projectStore = options.projectStore ?? createCodingProjectStore(options.storage);
|
||||
const attachments = new CodingAttachmentStore(
|
||||
path.join(options.paths.userDataDir, 'coding-runtime', 'attachments'),
|
||||
@@ -113,8 +114,8 @@ export function createCodingComposition(
|
||||
bundledSkillsDir: options.paths.bundledSkillsDir,
|
||||
loadProviderInput,
|
||||
resolveCredential: resolvePiProviderCredentialFromSecretStore,
|
||||
...(options.localProxyCredential
|
||||
? { getLocalProxyCredential: async () => options.localProxyCredential }
|
||||
...(getLocalProxyCredential
|
||||
? { getLocalProxyCredential: async () => getLocalProxyCredential() }
|
||||
: {}),
|
||||
extensionHost,
|
||||
}),
|
||||
@@ -129,8 +130,8 @@ export function createCodingComposition(
|
||||
loadProviderInput,
|
||||
resolveCredential: resolvePiProviderCredentialFromSecretStore,
|
||||
getRevision: () => revisions.current,
|
||||
...(options.localProxyCredential
|
||||
? { getLocalProxyCredential: async () => options.localProxyCredential }
|
||||
...(getLocalProxyCredential
|
||||
? { getLocalProxyCredential: async () => getLocalProxyCredential() }
|
||||
: {}),
|
||||
});
|
||||
const subagents = new PiSubagentScheduler({
|
||||
|
||||
Reference in New Issue
Block a user