Skip to content

Conversation

@tamuratak
Copy link

Safely destructure custom agents response to handle null/undefined. Fix microsoft/vscode#274437

Copilot AI review requested due to automatic review settings October 31, 2025 20:55
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 modifies the getCustomAgents method in the OctoKitService class to add an unnecessary object spread operation when destructuring the response from getCustomAgentsWithToken.

Key Changes

  • Added object spread syntax when destructuring the agents property from the API response

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! But should this happen in getCustomAgentsWithToken? Or does that method have the wrong return signature? TS should have helped us here.

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.

Error fetching custom agents: TypeError: Cannot destructure property 'agents' of '(intermediate value)' as it is undefined.

3 participants