Skip to content

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Feb 4, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 4, 2026 09:16
@alexr00 alexr00 self-assigned this Feb 4, 2026
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 pull request aims to refactor how session information is passed to menu actions by removing the args property from IMenuActionOptions and using only the arg property. The changes include:

Changes:

  • Removed the args property from IMenuActionOptions interface
  • Added a deprecation warning to the arg property
  • Removed support for spreading multiple arguments via args in MenuItemAction.run()
  • Updated chatInputPart.ts to pass session information using arg instead of args

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/platform/actions/common/actions.ts Removed args property from IMenuActionOptions interface, added deprecation comment to arg, and removed args handling logic from MenuItemAction.run()
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Changed from using args/arg conditionally to always using arg with an array or object value

} : {
arg: {
menuOptions: {
arg: sessionResource && (isSessionMenu ? [sessionResource, this.agentSessionsService.getSession(sessionResource)?.metadata] : {
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The refactoring changes the behavior when isSessionMenu is true. Previously, args: [sessionResource, metadata] would spread the array elements as separate arguments to the action. Now, arg: [sessionResource, metadata] passes the entire array as a single argument. This will break actions like ViewAllSessionChangesAction which expect the first parameter to be a URI | IAgentSession, not an array. The action signature is run(accessor: ServicesAccessor, sessionOrSessionResource?: URI | IAgentSession) at chatEditingActions.ts:370.

Suggested change
arg: sessionResource && (isSessionMenu ? [sessionResource, this.agentSessionsService.getSession(sessionResource)?.metadata] : {
arg: sessionResource && (isSessionMenu ? sessionResource : {

Copilot uses AI. Check for mistakes.
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.

2 participants