Skip to content

Conversation

@connor4312
Copy link
Member

Closes #276955

Copilot AI review requested due to automatic review settings November 12, 2025 19:33
@connor4312 connor4312 enabled auto-merge (squash) November 12, 2025 19:33
@connor4312 connor4312 self-assigned this Nov 12, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 12, 2025
Copilot finished reviewing on behalf of connor4312 November 12, 2025 19:36

const invalid = [...Array.from(invalidUris), ...additionalInvalidUrls];
const urlsNeedingConfirmation = [...webUris.values(), ...validFileUris];
const urlsNeedingConfirmation = new ResourceSet([...webUris.values(), ...validFileUris]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this pass some comparer to be case-insensitive?

@connor4312 connor4312 force-pushed the connor4312/fetch-mentioned-urls branch from 70ce322 to 9c66c5c Compare November 12, 2025 19:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements auto-approval for URLs that users have mentioned in their chat messages, reducing unnecessary confirmation prompts when the fetch tool is invoked for URLs the user has already referenced.

Key changes:

  • Changed urlsNeedingConfirmation from an array to a ResourceSet for better URI handling
  • Added auto-approval logic that checks if URLs were mentioned in user messages
  • Updated all array operations to work with the new ResourceSet structure using Iterable utilities

Comment on lines +728 to +732
const tool = new FetchWebPageTool(
new TestWebContentExtractorService(new ResourceMap<string>()), // Empty - all web requests fail
new ExtendedTestFileService(new ResourceMap<string | VSBuffer>()), // Empty - all file ,
new MockTrustedDomainService([]),
new MockChatService(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of repetition, could TestInstantiationService help here?

@connor4312 connor4312 merged commit d68a730 into main Nov 12, 2025
28 checks passed
@connor4312 connor4312 deleted the connor4312/fetch-mentioned-urls branch November 12, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto approve URLs that are mentioned explicitly by the user

5 participants