Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

  • Implement custom User-Agent header for axios requests
  • Implement custom User-Agent header for fetch fallback
  • Add unit test to verify User-Agent header configuration
  • Fix TypeScript build error with axios-cache-interceptor Storage type in all projects
Original prompt

This section details on the original issue you should resolve

<issue_title>Use custom agent header in axios web requests.</issue_title>
<issue_description>We should add a request header for user-agent that makes our web request worker singleton send the user agent header as 'vscode-dotnet-runtime' so we can see in telemetry where requests are coming from. We should add a small unit test to validate this and compare to see what the prior user agent header was in case there was protection already in place against the existing agent header for sending too many requests.

thank you @drewnoakes for the suggestion!</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add custom user agent header for axios requests Add custom User-Agent header to web requests for telemetry tracking Dec 2, 2025
Copilot AI requested a review from nagilson December 2, 2025 23:37
Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

../vscode-dotnet-runtime-library/node_modules/axios-cache-interceptor/dist/storage/web-api.d.ts(26,50): error TS2304: Cannot find name 'Storage'.

This causes the build to fail, fix it.

Copy link
Contributor Author

Copilot AI commented Dec 3, 2025

../vscode-dotnet-runtime-library/node_modules/axios-cache-interceptor/dist/storage/web-api.d.ts(26,50): error TS2304: Cannot find name 'Storage'.

This causes the build to fail, fix it.

Fixed in 080c9e3 by adding skipLibCheck: true to both extension tsconfig files. The axios-cache-interceptor library references the browser Storage type, which wasn't available in the "es6" lib configuration. Skipping lib checks is standard practice for Node.js projects using third-party libraries with browser types.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • microsoft.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-dotnet-runtime/vscode-dotnet-runtime/vscode-dotnet-runtime-library/node_modules/.bin/mocha -u tdd -- dist/test/unit/DebianDistroTests.test.js dist/test/unit/DotnetConditionValidator.test.js dist/test/unit/DotnetCoreAcquisitionWorker.test.js dist/test/unit/DotnetPathFinder.test.js dist/test/unit/DotnetResolver.test.js dist/test/unit/ErrorHandler.test.js dist/test/unit/ExecutableArchitectureDetector.test.js dist/test/unit/ExistingPathResolver.test.js dist/test/unit/GlobalInstallerResolver.test.js dist/test/unit/InstallScriptAcquisitionWorker.test.js dist/test/unit/InstallTracker.test.js dist/test/unit/InstallationValidator.test.js dist/test/unit/IssueReporter.test.js dist/test/unit/JsonInstaller.test.js dist/test/unit/LinuxDistroTests.test.js (dns block)
  • yttvsblobprodcus357.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm ci (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from nagilson December 3, 2025 00:52
@nagilson
Copy link
Member

nagilson commented Dec 4, 2025

@copilot please investigate the failure,
../vscode-dotnet-runtime-library/node_modules/axios-cache-interceptor/dist/storage/web-api.d.ts(26,50): error TS2304: Cannot find name 'Storage'.

This causes the build to fail, fix it.

Copy link
Contributor Author

Copilot AI commented Dec 4, 2025

@copilot please investigate the failure,
../vscode-dotnet-runtime-library/node_modules/axios-cache-interceptor/dist/storage/web-api.d.ts(26,50): error TS2304: Cannot find name 'Storage'.

...

Fixed in 6cf85b8. The build was failing on the sample project which was missing skipLibCheck: true. The previous fix in 080c9e3 addressed the extension projects but not the sample. All three projects (vscode-dotnet-runtime-extension, vscode-dotnet-sdk-extension, and sample) now have skipLibCheck enabled. Build now succeeds.

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.

Use custom agent header in axios web requests.

2 participants