Skip to content

sessions: Apply custom file icon themes in Files explorer - #335185

Closed
Dmitriy Vasyura (dmitrivMS) wants to merge 2 commits into
mainfrom
agents/fix-custom-icons-in-agents-explorer
Closed

sessions: Apply custom file icon themes in Files explorer#335185
Dmitriy Vasyura (dmitrivMS) wants to merge 2 commits into
mainfrom
agents/fix-custom-icons-in-agents-explorer

Conversation

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Summary

  • preserve supported declarative contributions from extensions that cannot execute in the Agents window
  • strip executable metadata, dependencies, activation events, and unsupported contributions from the restricted manifest
  • add regression coverage for an executable extension that contributes a custom file icon theme

This keeps the Agents window execution boundary intact while allowing its Files explorer to resolve the selected custom icon theme.

Fixes #335181

Validation

  • npm run compile
  • node build/hygiene.ts src/vs/workbench/services/extensions/common/abstractExtensionService.ts src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts src/vs/workbench/services/extensions/test/common/extensionManifestPropertiesService.test.ts
  • ExtensionManifestPropertiesService unit tests (35 passing)
  • manually launched an isolated Agents window with Catppuccin Icons selected

Register a non-executable manifest containing only the declarative contribution points supported by the Agents window when an extension cannot run there. This lets file icon themes remain available without enabling extension code or unsupported contributions.\n\nRefs #335181\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 9, 2026 00:47
Resolve the ExtensionManifestPropertiesService test import conflict by retaining both the upstream Agents window capability coverage and the custom icon theme regression coverage.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Initial host startup can still execute restricted extensions, while restart sanitization can disable exempt built-in extensions.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 2 High severity · 1 Medium severity

New issues introduced by this change (3)
Severity Finding
High severity src/​vs/​workbench/​services/​extensions/​common/​abstractExtensionService.ts — The restricted manifest is not used to initialize the first local extension host. Both…
High severity src/​vs/​workbench/​services/​extensions/​common/​abstractExtensionService.ts — This predicate does not match the existing Sessions-window enablement rules.…
Medium severity src/​vs/​workbench/​services/​extensions/​test/​common/​extensionManifestPropertiesService.test.ts — This test only calls the pure manifest helper, so it passes even though the initial extension-host…
What changed in this PR

Enables custom file icon themes in the Agents window while attempting to prevent extension code execution.

Changes:

  • Sanitizes unsupported extension manifests.
  • Applies sanitization during extension discovery and updates.
  • Adds unit coverage for manifest filtering.
File Description
abstractExtensionService.ts Applies Sessions-window manifest filtering.
extensionManifestPropertiesService.ts Creates restricted declarative manifests.
extensionManifestPropertiesService.test.ts Tests manifest sanitization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@@ -520,15 +523,15 @@ export abstract class AbstractExtensionService extends Disposable implements IEx

for await (const extensions of this._resolveExtensions()) {
if (extensions instanceof ResolverExtensions) {
resolverExtensions = checkEnabledAndProposedAPI(this._logService, this._extensionEnablementService, this._extensionsProposedApi, extensions.extensions, false);
resolverExtensions = checkEnabledAndProposedAPI(this._logService, this._extensionEnablementService, this._extensionsProposedApi, extensions.extensions.map(extension => this._getExtensionDescriptionForCurrentWindow(extension)), false);
Comment on lines +1154 to +1158
if (!this._environmentService.isSessionsWindow || this._extensionManifestPropertiesService.canExecuteOnSessionsWindow(extension)) {
return extension;
}

const safeExtension = toSessionsWindowSafeExtension(extension);
@@ -145,6 +145,45 @@ suite('ExtensionManifestPropertiesService - SessionsWindowSupport', () => {
], [true, false, false]);
});

test('restricts executable extensions to supported declarative contributions', () => {
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.

Custom file icon themes are not applied in the Agents window Files explorer

2 participants