sessions: count remote plugin customizations#313558
Draft
joshspicer wants to merge 3 commits intomicrosoft:mainfrom
Draft
sessions: count remote plugin customizations#313558joshspicer wants to merge 3 commits intomicrosoft:mainfrom
joshspicer wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the AI Customizations surfaces (workbench + sessions window) so plugin-related customizations coming from remote harness providers are counted and grouped correctly, while keeping sidebar/plugin list counts aligned with what’s actually rendered.
Changes:
- Add a dedicated
IAICustomizationItemsModel.getPluginCount()observable that combines local installed plugins with provider-supplied remote plugin rows (excludingremote-client). - Preserve provider-declared
storage/built-in origin during normalization even when inference inputs (likepluginUri/groupKey) are missing. - Align plugin list row counts with displayed rows and broaden “plugin item” detection via
isPluginCustomizationItem.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationListWidget.test.ts | Update stubs to include new getPluginCount() API. |
| src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationItemsModel.test.ts | Add coverage for storage preservation and plugin-count behavior (including local plugin changes). |
| src/vs/workbench/contrib/chat/common/customizationHarnessService.ts | Introduce isPluginCustomizationItem helper for consistent plugin-row detection. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.ts | Use isPluginCustomizationItem and exclude remote-client from the rendered-count calculation. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.ts | Implement getPluginCount() and remote plugin counting with stale-result protection. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.ts | Treat provider-supplied storage (plugin/built-in) as authoritative during normalization. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.ts | Extend storageToIcon to accept built-in storage and map it to the built-in icon. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.ts | Update debug panel state typing and include built-in storage counts. |
| src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.test.ts | Update mock model to implement getPluginCount(). |
| src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.fixture.ts | Add plugin count support to fixtures. |
| src/vs/sessions/contrib/sessions/browser/customizationsToolbar.contribution.ts | Drive Plugins badge count from itemsModel.getPluginCount() instead of plugin service directly. |
| src/vs/sessions/contrib/sessions/browser/aiCustomizationShortcutsWidget.ts | Update header total to include plugin count via items model; add explicit collapse-toggle button with click/tap handling. |
| src/vs/sessions/AI_CUSTOMIZATIONS.md | Document updated count consistency rules and provider-authoritative storage handling. |
Copilot's findings
- Files reviewed: 13/13 changed files
- Comments generated: 1
Remote agent-host customization providers can contribute plugin rows and plugin-sourced items without a local plugin URI. Preserve provider-declared storage while normalizing items and include remote provider plugin rows in sidebar plugin counts, excluding locally synced remote-client rows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the AHP harness reports plugins that are already known to IAgentPluginService (e.g. the local Copilot CLI surfaces its installed plugins as remote-host customizations), do not double-count or double-display them. Match by display name and fold harness-provided rows into the locally installed plugin. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a new 'data sources' suite to AICustomizationItemsModel tests that: - Validates getCount() for each prompts-based section (Agents, Skills, Instructions, Prompts, Hooks) reflects provider items filtered by the section's prompt type. - Validates getCount() refetches and updates when the provider fires onDidChange. - Validates getPluginCount() in three scenarios: only local plugins, only harness plugin rows (with type='plugin' / 'plugins' and remote-client filtered out), and a mix that exercises name-based dedup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fe8c1ad to
14e741f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
remote-clientrows.origin/maincustomizations header collapse-toggle/touch handling.Testing
npm run compile-check-ts-nativenode --experimental-strip-types build/hygiene.ts $(git --no-pager diff --name-only -- 'src/**/*.ts' 'src/**/*.md')npm run valid-layers-checknpm run transpile-client -- --quietenv -u ELECTRON_RUN_AS_NODE ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationItemsModel.test.ts --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationListWidget.test.ts --run src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.test.ts