show inline install X recommendations for alternative agents#280738
show inline install X recommendations for alternative agents#280738joshspicer merged 6 commits intomainfrom
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
There was a problem hiding this comment.
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.
In other words: the blue button will be gone pretty soon!
There was a problem hiding this comment.
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
ChatSessionsGettingStartedActionwhich 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
postInstallCommandfield 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 |
| const listener = CommandsRegistry.onDidRegisterCommand(id => { | ||
| if (id === commandId) { | ||
| listener?.dispose(); | ||
| timer.dispose(); | ||
| resolve(); | ||
| } | ||
| }); |
There was a problem hiding this comment.
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();
}
});|
@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? |
|
@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 |
revert chatSession registration tweaks from #280738
Reads product.json for the list of
chatSessionRecommendations. If the extension is not installed, showInstall X. If the recommendation has apostInstallCommand, fire that once it's available.