Skip to content

show inline install X recommendations for alternative agents#280738

Merged
joshspicer merged 6 commits intomainfrom
joshspicer/agent-recommendation-02
Dec 2, 2025
Merged

show inline install X recommendations for alternative agents#280738
joshspicer merged 6 commits intomainfrom
joshspicer/agent-recommendation-02

Conversation

@joshspicer
Copy link
Member

Reads product.json for the list of chatSessionRecommendations. If the extension is not installed, show Install X. If the recommendation has a postInstallCommand, fire that once it's available.

Copilot AI review requested due to automatic review settings December 2, 2025 20:06
@vs-code-engineering
Copy link

vs-code-engineering bot commented Dec 2, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.ts

bpasero
bpasero previously requested changes Dec 2, 2025
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

Since we already know that the agents view will merge into the chat view, I think we need to rethink how we approach this: we need to have a dynamic action contributed to the "+" action of the chat view itself because that is going to be the place where users will in the end pick which runtime to choose.

image

In other words: the blue button will be gone pretty soon!

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 refactors the chat session recommendation system to show inline "Install X" actions for uninstalled agent extensions. It replaces the previous modal quick-pick approach (ChatSessionsGettingStartedAction) with inline installation options directly in the agent sessions view dropdown menu. The implementation reads recommendations from product.json and supports running a postInstallCommand after extension installation completes.

Key Changes

  • Removed the ChatSessionsGettingStartedAction which showed a modal quick-pick for installing agent extensions
  • Added inline "Install X" actions in the agent sessions view dropdown that appear only for uninstalled recommended extensions
  • Added support for postInstallCommand field in recommendation configurations to run commands after installation

Reviewed changes

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

File Description
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Removed unused import and registration of ChatSessionsGettingStartedAction
src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.ts Removed the entire ChatSessionsGettingStartedAction class implementation and its unused imports
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.ts Added inline recommendation installation functionality with extension state tracking, automatic refresh on extension changes, and post-install command execution with timeout handling
src/vs/base/common/product.ts Added optional postInstallCommand field to IChatSessionRecommendation interface

Comment on lines +284 to +290
const listener = CommandsRegistry.onDidRegisterCommand(id => {
if (id === commandId) {
listener?.dispose();
timer.dispose();
resolve();
}
});
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The listener variable in waitForCommandRegistration could be used before it's assigned. The callback that uses listener is created immediately when calling onDidRegisterCommand, but listener is assigned the return value of that call. If the callback fires synchronously (which is unlikely but possible), listener?.dispose() would attempt to dispose undefined.

Consider creating the listener variable first and assigning it inside the callback setup:

let listener: IDisposable | undefined;
listener = CommandsRegistry.onDidRegisterCommand(id => {
  if (id === commandId) {
    listener?.dispose();
    timer.dispose();
    resolve();
  }
});

Copilot uses AI. Check for mistakes.
@joshspicer
Copy link
Member Author

joshspicer commented Dec 2, 2025

@bpasero this is a dynamic action (generated from the product.json). Are you just blocking because you want the dynamic action included in more places (beyond/instead the blue button)?

The blue button is around for at least this iteration, so it seems to make sense to include the actions there, no?

@bpasero
Copy link
Member

bpasero commented Dec 2, 2025

@joshspicer the blue button will be removed as soon as we merge "Agents" into "Chat" view. I am just saying to not invest into the blue button but focus on the ➕ action of the Chat view, as that is the prime target going forward.

Sorry if this was not clear from the beginning 🙏

Btw I can already predict that we may want to surface this dynamic action in other menus that we still need to implement, namely: some kind of picker in the chat input box. But I assume we can do that with a MenuId once we have it introduced.

@joshspicer joshspicer dismissed bpasero’s stale review December 2, 2025 23:09

Address feedback

@joshspicer joshspicer enabled auto-merge (squash) December 2, 2025 23:12
@joshspicer joshspicer merged commit 34e8399 into main Dec 2, 2025
29 checks passed
@joshspicer joshspicer deleted the joshspicer/agent-recommendation-02 branch December 2, 2025 23:49
joshspicer added a commit that referenced this pull request Dec 3, 2025
revert chatSession registration tweaks from #280738
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants