Skip to content

Commit 5ff5e9b

Browse files
authored
Merge branch 'main' into justin/carbink
2 parents f3e4709 + 15d2d8c commit 5ff5e9b

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,22 @@ export class AgentHostContribution extends Disposable implements IWorkbenchContr
152152
const agentId = sessionType;
153153
const vendor = sessionType;
154154

155+
// In the Agents app, the agent-host displayName is unambiguous because
156+
// only agent-host sessions exist there. In VS Code, the same picker
157+
// also lists the extension-host harness with the same displayName
158+
// (e.g. "Copilot CLI"), so suffix with "- Agent Host" to disambiguate.
159+
const displayName = this._isSessionsWindow
160+
? agent.displayName
161+
: localize('agentHost.displayName', "{0} - Agent Host", agent.displayName);
162+
155163
// Chat session contribution.
156164
// In the Agents app, hide the delegation picker for local agent host
157165
// sessions (matches behavior of remote agent host sessions). In VS Code,
158166
// keep the picker available so users can hand off to other targets.
159167
store.add(this._chatSessionsService.registerChatSessionContribution({
160168
type: sessionType,
161169
name: agentId,
162-
displayName: agent.displayName,
170+
displayName,
163171
description: agent.description,
164172
canDelegate: true,
165173
requiresCustomModels: true,

src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,19 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
810810
}
811811

812812
this._contributions.set(contribution.type, { contribution, extension: undefined });
813+
// Programmatically-registered contributions are always considered
814+
// available; mark them as such so the autorun in the constructor
815+
// registers the in-place "New {0} Session" action for them. Without
816+
// this, types like `agent-host-copilotcli` (registered by the local
817+
// agent host) have no `openNewChatSessionInPlace.<type>` command.
818+
this._contributionDisposables.set(contribution.type, new DisposableStore());
819+
this._updateHasCanDelegateProvidersContextKey();
813820
this._onDidChangeAvailability.fire();
814821

815822
return toDisposable(() => {
816823
this._contributions.delete(contribution.type);
824+
this._contributionDisposables.deleteAndDispose(contribution.type);
825+
this._updateHasCanDelegateProvidersContextKey();
817826
this._onDidChangeAvailability.fire();
818827
});
819828
}

0 commit comments

Comments
 (0)