diff --git a/package.json b/package.json index 5bf0617925..ffeb1d6611 100644 --- a/package.json +++ b/package.json @@ -3313,6 +3313,14 @@ "type": "string", "description": "The key of the notification" }, + "itemNumber": { + "type": "string", + "description": "The number of the issue/PR in the notification" + }, + "itemType": { + "type": "string", + "description": "The type of the item in the notification - whether it is an issue or a PR" + }, "fileChanges": { "type": "array", "items": { diff --git a/src/lm/tools/fetchNotificationTool.ts b/src/lm/tools/fetchNotificationTool.ts index c0ca119141..40adfe8c7b 100644 --- a/src/lm/tools/fetchNotificationTool.ts +++ b/src/lm/tools/fetchNotificationTool.ts @@ -30,6 +30,8 @@ export interface FetchNotificationResult { }[]; owner: string; repo: string; + itemNumber: string; + itemType: 'issue' | 'pr'; fileChanges?: FileChange[]; threadId: number, notificationKey: string @@ -54,8 +56,8 @@ export class FetchNotificationTool extends RepoToolBase { public static readonly toolId = 'github-pull-request_notification_summarize'; + async prepareInvocation(options: vscode.LanguageModelToolInvocationPrepareOptions): Promise { + const parameters = options.parameters; + const type = parameters.itemType === 'issue' ? 'issues' : 'pull'; + const url = `https://github.com/${parameters.owner}/${parameters.repo}/${type}/${parameters.itemNumber}`; + return { + invocationMessage: vscode.l10n.t('Fetching item [#{0}]({1}) from GitHub', parameters.itemNumber, url) + }; + } + async invoke(options: vscode.LanguageModelToolInvocationOptions, _token: vscode.CancellationToken): Promise { let notificationInfo: string = ''; const lastReadAt = options.parameters.lastReadAt;