Skip to content

Commit 0309d4a

Browse files
committed
remove unrelated fix
1 parent b2f01e0 commit 0309d4a

1 file changed

Lines changed: 7 additions & 25 deletions

File tree

src/client/chat/installPackagesTool.ts

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,33 +104,15 @@ export class InstallPackagesTool extends BaseTool<IInstallPackageArgs>
104104
'installerNotSupported',
105105
);
106106
}
107-
const succeeded: string[] = [];
108-
const failed: { pkg: string; error: string }[] = [];
109107
for (const packageName of options.input.packageList) {
110-
try {
111-
await installer.installModule(packageName, resourcePath, token, undefined, {
112-
installAsProcess: true,
113-
hideProgress: true,
114-
});
115-
succeeded.push(packageName);
116-
} catch (error) {
117-
if (isCancellationError(error)) {
118-
throw error;
119-
}
120-
failed.push({ pkg: packageName, error: `${error}` });
121-
}
108+
await installer.installModule(packageName, resourcePath, token, undefined, {
109+
installAsProcess: true,
110+
hideProgress: true,
111+
});
122112
}
123-
const parts: string[] = [];
124-
if (succeeded.length > 0) {
125-
parts.push(`Successfully installed: ${succeeded.join(', ')}`);
126-
}
127-
if (failed.length > 0) {
128-
parts.push(`Failed to install: ${failed.map((f) => `${f.pkg} (${f.error})`).join(', ')}`);
129-
}
130-
if (succeeded.length === 0 && failed.length > 0) {
131-
throw new ErrorWithTelemetrySafeReason(parts.join('. '), 'installFailed');
132-
}
133-
return new LanguageModelToolResult([new LanguageModelTextPart(parts.join('. '))]);
113+
// format and return
114+
const resultMessage = `Successfully installed ${packagePlurality}: ${options.input.packageList.join(', ')}`;
115+
return new LanguageModelToolResult([new LanguageModelTextPart(resultMessage)]);
134116
} catch (error) {
135117
if (isCancellationError(error)) {
136118
throw error;

0 commit comments

Comments
 (0)