Skip to content

Commit 9f8d4fd

Browse files
deepak1556Copilot
andauthored
chore: use protocol from product configuration for openAgentsWindow action (#307585)
* chore: use protocol from product configuration for openAgentsWindow action * chore: address review feedback Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: fix build --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent bd5165a commit 9f8d4fd

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

src/vs/base/common/product.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface IProductConfiguration {
7676
readonly win32AppUserModelId?: string;
7777
readonly win32MutexName?: string;
7878
readonly win32RegValueName?: string;
79+
readonly win32NameVersion?: string;
7980
readonly win32VersionedUpdate?: boolean;
8081
readonly win32SiblingExeBasename?: string;
8182
readonly applicationName: string;
@@ -232,8 +233,25 @@ export interface IProductConfiguration {
232233
readonly remoteDefaultExtensionsIfInstalledLocally?: string[];
233234

234235
readonly extensionConfigurationPolicy?: IStringDictionary<IPolicy>;
236+
237+
readonly embedded?: IEmbeddedProductConfiguration;
235238
}
236239

240+
export type IEmbeddedProductConfiguration = Pick<IProductConfiguration,
241+
'nameShort' |
242+
'nameLong' |
243+
'applicationName' |
244+
'dataFolderName' |
245+
'darwinBundleIdentifier' |
246+
'urlProtocol' |
247+
'win32AppUserModelId' |
248+
'win32MutexName' |
249+
'win32RegValueName' |
250+
'win32NameVersion' |
251+
'win32VersionedUpdate' |
252+
'win32SiblingExeBasename'
253+
>;
254+
237255
export interface ITunnelApplicationConfig {
238256
authenticationProviders: IStringDictionary<{ scopes: string[] }>;
239257
editorWebUrl: string;

src/vs/workbench/contrib/chat/electron-browser/agentSessions/agentSessionsActions.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,8 @@ export class OpenAgentsWindowAction extends Action2 {
4040
const productService = accessor.get(IProductService);
4141
const environmentService = accessor.get(IWorkbenchEnvironmentService);
4242

43-
if (environmentService.isBuilt && (isMacintosh || isWindows)) {
44-
const scheme = productService.quality === 'stable'
45-
? 'vscode-agents'
46-
: productService.quality === 'exploration'
47-
? 'vscode-agents-exploration'
48-
: 'vscode-agents-insiders';
49-
50-
await openerService.open(URI.from({ scheme, authority: Schemas.file }), { openExternal: true });
43+
if (environmentService.isBuilt && (isMacintosh || isWindows) && productService.embedded?.urlProtocol) {
44+
await openerService.open(URI.from({ scheme: productService.embedded.urlProtocol, authority: Schemas.file }), { openExternal: true });
5145
} else {
5246
const nativeHostService = accessor.get(INativeHostService);
5347
await nativeHostService.openAgentsWindow();

0 commit comments

Comments
 (0)