Skip to content

Conversation

@XInTheDark
Copy link
Owner

@XInTheDark XInTheDark commented Mar 29, 2025

Support setting a default model for each command. This includes built-in commands and custom AI commands.

@XInTheDark XInTheDark added the feature New feature label Mar 29, 2025
@XInTheDark XInTheDark requested a review from Copilot March 29, 2025 10:25
Copy link

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 introduces support for configuring a specific model for each command, including both built-in and custom AI commands. The changes add a new model property to command configuration objects and update various components and API functions to account for the new command-specific model setting.

  • Added a new "commandId" parameter to many commands.
  • Extended command configuration objects with a "model" property.
  • Updated UI components and API calls to select and display the appropriate model.

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/improve.jsx Added the commandId for the "improve" command.
src/helpers/customCommands.jsx Extended the CustomCommand constructor with a new model property.
src/helpers/commandsHelper.js Minor updates to support command configuration.
src/friendly.jsx, src/format.jsx, src/fixCode.jsx, src/explain.jsx, src/continue.jsx, src/askAboutSelectedText.jsx, src/askAboutBrowserTab.jsx, src/askAI.jsx Consistently added commandId for individual commands.
src/customAICommands.jsx Added model handling and updated the UI form to configure a command’s model.
src/components/preferences/options/generalOptions.jsx, src/components/preferences/options/commandOptions.jsx Introduced UI changes to enable selection of the model for commands.
src/components/preferences/base/valueDropdown.jsx, src/components/preferences/base/optionsComponent.jsx Adjusted usage of the dropdownComponent to accommodate its invocation.
src/api/providers.js, src/api/gpt.jsx Updated provider logic to use command-specific configuration when available.
src/aiChat.jsx Revised description text to reflect the new focus on the model setting.
Comments suppressed due to low confidence (2)

src/components/preferences/base/valueDropdown.jsx:45

  • Ensure that dropdownComponent is always a function; if there is a possibility it might not be, add a check or refactor its usage to avoid runtime errors.
{dropdownComponent()}

src/customAICommands.jsx:208

  • [nitpick] Consider using an empty array instead of null for allowedProviders when no model is specified to maintain consistent data types for downstream processing.
allowedProviders: command.model ? [command.model] : null,

@XInTheDark XInTheDark merged commit d36ffd4 into main Mar 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants