Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
87173b4
Remove `IToolInvocationContext.sessionId`
mjbvz Feb 10, 2026
cb6f565
Update src/vs/workbench/contrib/chat/common/tools/languageModelToolsS…
mjbvz Feb 10, 2026
696342d
Better fixes for mcp
mjbvz Feb 11, 2026
7d7012e
Add missing change
mjbvz Feb 11, 2026
77ed816
Fix lint
mjbvz Feb 11, 2026
a348a06
Avoid hardcoding models (#289694)
chrmarti Feb 17, 2026
9777d84
Enhance minimap autohide functionality and improve sticky widget styles
mrleemurray Feb 17, 2026
4960dbf
Add hover background for sticky line content in editor
mrleemurray Feb 17, 2026
152d29b
Fix sticky widget styles for reduced transparency theme
mrleemurray Feb 17, 2026
2b42a80
Enhance quick input list styles for better visibility and interaction
mrleemurray Feb 17, 2026
cebaef1
Fix indentation
mrleemurray Feb 17, 2026
7520304
Add hover background for sticky scroll in dark and light themes
mrleemurray Feb 17, 2026
71292f2
Merge pull request #295749 from microsoft/mrleemurray/static-rose-grouse
mrleemurray Feb 17, 2026
6b97e58
chore: bump distro (#295761)
deepak1556 Feb 17, 2026
b1009c9
Sessions exploration (#294912)
bpasero Feb 17, 2026
d797e9f
sessions - tweak workspace settings for `vs/sessions` (#295775)
bpasero Feb 17, 2026
d112b39
chore: update application name logic for win32 scripts (#295777)
deepak1556 Feb 17, 2026
8ad59c5
SCM - fix cyclic dependency (#295779)
lszomoru Feb 17, 2026
2a817bb
Engineering - Delete the worktree hook file for the time being (#295776)
lszomoru Feb 17, 2026
7ff8986
Add list scroll right offset variable (#295741)
alexr00 Feb 17, 2026
6e848fc
Merge pull request #294259 from mjbvz/dev/mjbvz/elderly-jellyfish
mjbvz Feb 17, 2026
a102af4
Right align actions tree view (#295266)
sam-shubham Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 224 additions & 0 deletions .github/instructions/ai-customization.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
---
description: Architecture documentation for VS Code AI Customization view. Use when working in `src/vs/workbench/contrib/chat/browser/aiCustomization`
applyTo: 'src/vs/workbench/contrib/chat/browser/aiCustomization/**'
---

# AI Customization View

The AI Customization view provides a unified view for discovering and managing AI customization 'artifacts' (customizations that augment LLM prompts or behavior).

Examples of these include: Custom Agents, Skills, Instructions, and Prompts. It surfaces prompt files that are typically hidden in `.github/` folders, user data directories, workspace settings, or exposed via extensions.

## Overview

The view displays a hierarchical tree structure:

```
AI Customization (View Container)
└── AI Customization (Tree View)
├── Custom Agents (.agent.md files)
│ ├── Workspace
│ │ └── agent files...
│ ├── User
│ │ └── agent files...
│ └── Extensions
│ └── agent files...
├── Skills (SKILL.md files)
│ └── (same storage structure)
├── Instructions (.instructions.md files)
│ └── (same storage structure)
└── Prompts (.prompt.md files)
└── (same storage structure)
```

**Key Features:**
- 3-level tree hierarchy: Category → Storage Group → Files
- Auto-expands category nodes on initial load and refresh to show storage groups
- Symbol-based root element for type safety
- Double-click to open files in editor
- Context menu support with Open and Run Prompt actions
- Toolbar actions: New dropdown, Refresh, Collapse All
- Skill names parsed from frontmatter with fallback to folder name
- Responsive to IPromptsService change events

## File Structure

All files are located in `src/vs/workbench/contrib/chat/browser/aiCustomization/`:

```
aiCustomization/
├── aiCustomization.ts # Constants, IDs, and MenuIds
├── aiCustomization.contribution.ts # View registration and actions
├── aiCustomizationViews.ts # Tree view pane implementation
├── aiCustomizationIcons.ts # Icon registrations
└── media/
└── aiCustomization.css # Styling
```

## Key Constants (aiCustomization.ts)

- `AI_CUSTOMIZATION_VIEWLET_ID`: View container ID for sidebar
- `AI_CUSTOMIZATION_VIEW_ID`: Unified tree view ID
- `AI_CUSTOMIZATION_STORAGE_ID`: State persistence key
- `AICustomizationItemMenuId`: Context menu ID
- `AICustomizationNewMenuId`: New item submenu ID

## View Registration (aiCustomization.contribution.ts)

### View Container

Register sidebar container with:
- ViewPaneContainer with `mergeViewWithContainerWhenSingleView: true`
- Keyboard shortcut: Cmd+Shift+I
- Location: Sidebar
- Visibility: `when: ChatContextKeys.enabled` (respects AI disable setting)

### View Descriptor

Register single unified tree view:
- Constructor: `AICustomizationViewPane`
- Toggleable and moveable
- Gated by `ChatContextKeys.enabled`

### Welcome Content

Shows markdown links to create new items when tree is empty.

## Toolbar Actions

**New Item Dropdown** - Submenu in view title:
- Add icon in navigation group
- Submenu contains: New Agent, New Skill, New Instructions, New Prompt
- Each opens PromptFilePickers to guide user through creation

**Refresh** - ViewAction that calls `view.refresh()`

**Collapse All** - ViewAction that calls `view.collapseAll()`

All actions use `ViewAction<AICustomizationViewPane>` pattern and are gated by `when: view === AI_CUSTOMIZATION_VIEW_ID`.

## Tree View Implementation (aiCustomizationViews.ts)

### Tree Item Types

Discriminated union with `type` field:

**ROOT_ELEMENT** - Symbol marker for type-safe root

**IAICustomizationTypeItem** (`type: 'category'`)
- Represents: Custom Agents, Skills, Instructions, Prompts
- Contains: label, promptType, icon

**IAICustomizationGroupItem** (`type: 'group'`)
- Represents: Workspace, User, Extensions
- Contains: label, storage, promptType, icon

**IAICustomizationFileItem** (`type: 'file'`)
- Represents: Individual prompt files
- Contains: uri, name, description, storage, promptType

### Data Source

`UnifiedAICustomizationDataSource` implements `IAsyncDataSource`:

**getChildren logic:**
- ROOT → 4 categories (agent, skill, instructions, prompt)
- category → storage groups (workspace, user, extensions) that have items
- group → files from `promptsService.listPromptFilesForStorage()` or `findAgentSkills()`

**Skills special handling:** Uses `findAgentSkills()` to get names from frontmatter instead of filenames

### Tree Renderers

Three specialized renderers for category/group/file items:
- **Category**: Icon + bold label
- **Group**: Uppercase label with descriptionForeground color
- **File**: Icon + name with tooltip

### View Pane

`AICustomizationViewPane extends ViewPane`:

**Injected services:**
- IPromptsService - data source
- IEditorService - open files
- IMenuService - context menus

**Initialization:**
1. Subscribe to `onDidChangeCustomAgents` and `onDidChangeSlashCommands` events
2. Create WorkbenchAsyncDataTree with 3 renderers and data source
3. Register handlers: `onDidOpen` (double-click) → open file, `onContextMenu` → show menu
4. Set input to ROOT_ELEMENT and auto-expand categories

**Auto-expansion:**
- After setInput, iterate root children and expand each category
- Reveals storage groups without user interaction
- Applied on both initial load and refresh

**Public API:**
- `refresh()` - Reload tree and re-expand categories
- `collapseAll()` - Collapse all nodes
- `expandAll()` - Expand all nodes

## Context Menu Actions

Menu ID: `AICustomizationItemMenuId`

**Actions:**
- **Open** - Opens file in editor using IEditorService
- **Run Prompt** - Only for prompt files, invokes chat with prompt

**URI handling:** Actions must handle both URI objects and serialized strings
- Check `URI.isUri(context)` first
- Parse string variants with `URI.parse()`

**Context passing:**
- Serialize context as `{ uri: string, name: string, promptType: PromptsType }`
- Use `shouldForwardArgs: true` in getMenuActions
- Only show context menu for file items (not categories/groups)

## Icons (aiCustomizationIcons.ts)

Themed icons using `registerIcon(id, codicon, label)`:

**View/Types:**
- aiCustomizationViewIcon - Codicon.sparkle
- agentIcon - Codicon.copilot
- skillIcon - Codicon.lightbulb
- instructionsIcon - Codicon.book
- promptIcon - Codicon.bookmark

**Storage:**
- workspaceIcon - Codicon.folder
- userIcon - Codicon.account
- extensionIcon - Codicon.extensions

## Styling (media/aiCustomization.css)

**Layout:** Full height view and tree container

**Tree items:** Flex layout with 16px icon + text, ellipsis overflow

**Categories:** Bold font-weight

**Groups:** Uppercase, small font (11px), letter-spacing, descriptionForeground color

## Integration Points

**IPromptsService:**
- `listPromptFilesForStorage(type, storage)` - Get files for a type/storage combo
- `findAgentSkills()` - Get skills with names parsed from frontmatter
- `onDidChangeCustomAgents` - Refresh on agent changes
- `onDidChangeSlashCommands` - Refresh on command changes

**PromptsType enum:** `instructions | prompt | agent | skill`

**PromptsStorage enum:** `local` (workspace) | `user` | `extension`

**AI Feature Gating:** View gated by `ChatContextKeys.enabled` (respects `chat.disableAIFeatures` setting)

**Registration:** Import `./aiCustomization/aiCustomization.contribution.js` in `chat.contribution.ts`

---

*Update this file when making architectural changes to the AI Customization view.*
13 changes: 13 additions & 0 deletions .github/instructions/sessions.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: Architecture documentation for the Agent Sessions window — a sessions-first app built as a new top-level layer alongside vs/workbench. Covers layout, parts, chat widget, contributions, entry points, and development guidelines. Use when working in `src/vs/sessions`
applyTo: src/vs/sessions/**
---

# Agent Sessions Window

The Agent Sessions window is a **standalone application** built as a new top-level layer (`vs/sessions`) in the VS Code architecture. It provides a sessions-first experience optimized for agent workflows — a simplified, fixed-layout workbench where chat is the primary interaction surface and editors appear as modal overlays.

When working on files under `src/vs/sessions/`, use these skills for detailed guidance:

- **`sessions`** skill — covers the full architecture: layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines
- **`agent-sessions-layout`** skill — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements
80 changes: 80 additions & 0 deletions .github/skills/agent-sessions-layout/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: agent-sessions-layout
description: Agent Sessions workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agent Sessions workbench layout.
---

When working on the Agent Sessions workbench layout, always follow these guidelines:

## 1. Read the Specification First

The authoritative specification for the Agent Sessions layout lives at:

**`src/vs/sessions/LAYOUT.md`**

Before making any changes to the layout code, read and understand the current spec. It defines:

- The fixed layout structure (grid tree, part positions, default sizes)
- Which parts are included/excluded and their visibility defaults
- Titlebar configuration and custom menu IDs
- Editor modal overlay behavior and sizing
- Part visibility API and events
- Agent session part classes and storage keys
- Workbench contributions and lifecycle
- CSS classes and file structure

## 2. Keep the Spec in Sync

If you modify the layout implementation, you **must** update `LAYOUT.md` to reflect those changes. The spec should always match the code. This includes:

- Adding/removing parts or changing their positions
- Changing default visibility or sizing
- Adding new actions, menus, or contributions
- Modifying the grid structure
- Changing titlebar configuration
- Adding new CSS classes or file structure changes

Update the **Revision History** table at the bottom of `LAYOUT.md` with a dated entry describing what changed.

## 3. Implementation Principles

When proposing or implementing changes, follow these rules from the spec:

1. **Maintain fixed positions** — Do not add settings-based position customization
2. **Panel must span the right section width** — The grid structure places the panel below Chat Bar and Auxiliary Bar only
3. **Sidebar spans full height** — Sidebar is in the main content branch, spanning from top to bottom
4. **New parts go in the right section** — Any new parts should be added to the horizontal branch alongside Chat Bar and Auxiliary Bar
5. **Preserve no-op methods** — Unsupported features (zen mode, centered layout, etc.) should remain as no-ops, not throw errors
6. **Handle pane composite lifecycle** — When hiding/showing parts, manage the associated pane composites
7. **Use agent session parts** — New part functionality goes in the agent session part classes (`SidebarPart`, `AuxiliaryBarPart`, `PanelPart`, `ChatBarPart`), not the standard workbench parts
8. **Use separate storage keys** — Agent session parts use their own storage keys (prefixed with `workbench.agentsession.` or `workbench.chatbar.`) to avoid conflicts with regular workbench state
9. **Use agent session menu IDs** — Actions should use `Menus.*` menu IDs (from `sessions/browser/menus.ts`), not shared `MenuId.*` constants

## 4. Key Files

| File | Purpose |
|------|---------|
| `sessions/LAYOUT.md` | Authoritative specification |
| `sessions/browser/workbench.ts` | Main layout implementation (`Workbench` class) |
| `sessions/browser/menus.ts` | Agent sessions menu IDs (`Menus` export) |
| `sessions/browser/layoutActions.ts` | Layout actions (toggle sidebar, panel, secondary sidebar) |
| `sessions/browser/paneCompositePartService.ts` | `AgenticPaneCompositePartService` |
| `sessions/browser/style.css` | Layout-specific styles |
| `sessions/browser/parts/` | Agent session part implementations |
| `sessions/browser/parts/titlebarPart.ts` | Titlebar part, MainTitlebarPart, AuxiliaryTitlebarPart, TitleService |
| `sessions/browser/parts/editorModal.ts` | Editor modal overlay |
| `sessions/browser/parts/sidebarPart.ts` | Sidebar part (with footer) |
| `sessions/browser/parts/chatBarPart.ts` | Chat Bar part |
| `sessions/browser/widget/` | Agent sessions chat widget |
| `sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts` | Title bar widget and session picker |
| `sessions/contrib/chat/browser/runScriptAction.ts` | Run script contribution |
| `sessions/contrib/accountMenu/browser/account.contribution.ts` | Account widget for sidebar footer |

## 5. Testing Changes

After modifying layout code:

1. Verify the build compiles without errors via the `VS Code - Build` task
2. Ensure the grid structure matches the spec's visual representation
3. Confirm part visibility toggling works correctly (show/hide/maximize)
4. Test the editor modal opens/closes properly on editor events
5. Verify sidebar footer renders with account widget
Loading
Loading