Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Terminal confirmation dialogs now display the command goal as a subtitle, providing immediate context about the command's purpose.

Before:

Run `pwsh` command?

After:

Run `pwsh` command? — Install dependencies

Changes

  • Added new required goal parameter to runInTerminal tool's input schema
  • Updated IRunInTerminalInputParams interface to include goal field
  • Added optional subtitle field to IToolConfirmationMessages interface
  • Set subtitle from goal parameter in RunInTerminalTool.prepareToolInvocation()
  • Pass subtitle to ChatCustomConfirmationWidget in terminal confirmation rendering
  • Updated all test cases to include goal parameter

Implementation

The LLM now provides two separate parameters for better UX:

  • goal: Short, focused purpose shown as subtitle (e.g., "Install dependencies")
  • explanation: Detailed description for context/hover (e.g., "Install npm packages required for the project")

The subtitle leverages existing ChatQueryTitlePart infrastructure, rendering via a <small> element with en-dash separator defined in CSS. The subtitle field remains optional for backwards compatibility.

Original prompt

This section details on the original issue you should resolve

<issue_title>Explore showing the goal in the terminal confirmation</issue_title>
<issue_description>Run pwsh command?

Could be followed by the goal of the command in the confirmation widget.</issue_description>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
Copilot AI changed the title [WIP] Explore showing the goal in terminal confirmation Show command goal as subtitle in terminal confirmation dialog Jan 16, 2026
Copilot AI requested a review from Tyriar January 16, 2026 17:02
Tyriar
Tyriar previously requested changes Jan 16, 2026
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

@copilot this is all wrong. This should be a new argument in the runInTerminal tool definition.

Copilot AI and others added 2 commits January 16, 2026 17:23
- Added 'goal' parameter to tool inputSchema for LLM to provide command purpose
- Updated IRunInTerminalInputParams interface to include goal field
- Set subtitle from goal parameter in confirmation messages
- Updated all tests to include goal parameter

Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot this is all wrong. This should be a new argument in the runInTerminal tool definition.

Fixed in 4d6d648. Added a new goal parameter to the runInTerminal tool's input schema instead of reusing the explanation field. The LLM now provides:

  • goal: Short purpose shown as subtitle (e.g., "Install dependencies")
  • explanation: Detailed context shown on hover (e.g., "Install npm packages required for the project")

Copilot AI changed the title Show command goal as subtitle in terminal confirmation dialog Add goal parameter to runInTerminal tool for subtitle display Jan 16, 2026
Copilot AI requested a review from Tyriar January 16, 2026 17:26
@Tyriar
Copy link
Member

Tyriar commented Jan 17, 2026

image

@Tyriar Tyriar force-pushed the copilot/explore-goal-confirmation-widget branch from bea57d1 to 12e1032 Compare January 17, 2026 09:47
@Tyriar Tyriar marked this pull request as ready for review January 17, 2026 09:49
Copilot AI review requested due to automatic review settings January 17, 2026 09:49
@Tyriar Tyriar enabled auto-merge January 17, 2026 09:49
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 adds a goal parameter to the runInTerminal tool to display the command's purpose as a subtitle in terminal confirmation dialogs. The intent is to provide users with immediate context about what a command does, showing a short goal alongside the confirmation title (e.g., "Run pwsh command? — Install dependencies").

Changes:

  • Added required goal parameter to the runInTerminal tool's input schema
  • Updated IRunInTerminalInputParams interface to include the goal field
  • Modified confirmation message construction to incorporate the goal
  • Updated all test cases to include the goal parameter in their test data

Reviewed changes

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

File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Added goal parameter to tool schema, made it required, and modified confirmation message to include goal (though implementation has issues)
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts Updated all test cases to include the goal parameter; added test for subtitle behavior (though test doesn't verify the subtitle)
Comments suppressed due to low confidence (2)

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts:604

  • The goal parameter should be set as the originMessage field in the returned IPreparedToolInvocation object to display it as a subtitle in the confirmation dialog. Currently, the goal is being concatenated into the message field instead.

According to the PR description, the goal should appear as a subtitle (e.g., "Run pwsh command? — Install dependencies"), which is achieved by setting originMessage in the return value. The subtitle is then automatically rendered from originMessage in the confirmation widget.

The return statement should include:

  • originMessage: args.goal to display the goal as a subtitle
  • The message field should only contain the explanation, not both explanation and goal concatenated together

This issue also appears in the following locations of the same file:

  • line 596
		const confirmationMessages = isFinalAutoApproved ? undefined : {
			title: confirmationTitle,
			message: new MarkdownString(localize('runInTerminal.confirmationMessage', "Explanation: {0}\n\nGoal: {1}", args.explanation, args.goal)),
			disclaimer,
			terminalCustomActions: customActions,
		};

		return {
			confirmationMessages,
			toolSpecificData,
		};

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts:596

  • The message field should only contain the explanation parameter, not a concatenation of both explanation and goal. The goal should be displayed as a subtitle via the originMessage field instead.

The message should be:
message: new MarkdownString(args.explanation)

This allows the explanation to provide detailed context in the confirmation dialog body, while the goal appears as a concise subtitle in the title area.

			message: new MarkdownString(localize('runInTerminal.confirmationMessage', "Explanation: {0}\n\nGoal: {1}", args.explanation, args.goal)),

@Tyriar Tyriar merged commit 405efc4 into main Jan 26, 2026
22 checks passed
@Tyriar Tyriar deleted the copilot/explore-goal-confirmation-widget branch January 26, 2026 09:26
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.

Explore showing the goal in the terminal confirmation

3 participants