Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9415abf
fix: guard against null in doRemoveFromValueTree (fixes #316034)
vs-code-engineering[bot] May 12, 2026
9f70c92
fix: restore protected modifier on relayCreationTimeoutMs in test helper
NikolaRHristov May 12, 2026
c5061c3
fix: expose relayCreationTimeoutMs via test-only setter to satisfy ma…
NikolaRHristov May 12, 2026
7326d26
Enable output renderers for code blocks in chat
mjbvz May 12, 2026
06115d9
Add improved markdown front matter rendering
mjbvz May 12, 2026
5284fa1
sessions: use delegation for active session and force replace on sess…
sandy081 May 13, 2026
22aa13f
Remove deprecated token fields (#316230)
lramos15 May 13, 2026
d4a82f0
sessions: fix customization harness layer violation by using session …
sandy081 May 13, 2026
40f8fa4
fix window controls in agents window
benibenj May 13, 2026
acd78ab
Merge pull request #316238 from microsoft/benibenj/technical-gazelle
benibenj May 13, 2026
104aa07
fix window title in agentTtitleBarStatusWidget
benibenj May 13, 2026
fcbd887
Remove old telemetry pipeline (#316236)
lramos15 May 13, 2026
1f66fd7
sessions: improve AI readiness of skill and instruction files (#316239)
sandy081 May 13, 2026
87241c4
Make appearedInsideViewport in InlineCompletionsModel reactive (#2899…
yavanosta May 13, 2026
b8363eb
Merge pull request #316247 from microsoft/benibenj/lesser-hippopotamus
benibenj May 13, 2026
f30fb07
Wait longer to get settings in `_developer.getConfigurationInformatio…
alexr00 May 13, 2026
d44e26a
Merge pull request #316041 from microsoft/fix/config-null-guard-31603…
bryanchen-d May 13, 2026
3016c0c
Chat input notification fixes (#316105)
pwang347 May 13, 2026
fec57be
AgentCustomizationItemProvider for both local and remote (#315272)
aeschli May 13, 2026
cb9d658
update context keys
benibenj May 13, 2026
e97a958
Prevent alt-buffer hang in agent host terminals (#316177)
anthonykim1 May 13, 2026
dc3fcfe
Support model pinning (#316253)
lramos15 May 13, 2026
40fdd83
fix: correct off-by-one in PreferredExtensionsPagedModel page lookup …
vs-code-engineering[bot] May 13, 2026
5060335
Set COPILOT_AGENT env var in agent terminals (#316267)
meganrogge May 13, 2026
bb200f4
Merge pull request #316049 from CodeEditorLand/fix-protected-override-1
connor4312 May 13, 2026
44ea338
Fix missing separator (#316270)
lramos15 May 13, 2026
b1ab6f1
Merge pull request #316138 from microsoft/dev/mjbvz/unaware-quail
mjbvz May 13, 2026
7b65828
Bump protobufjs from 7.5.5 to 7.5.8 in /extensions/copilot (#316074)
dependabot[bot] May 13, 2026
b64b5fc
Merge pull request #316147 from microsoft/dev/mjbvz/yeasty-armadillo
mjbvz May 13, 2026
b34d6ea
Merge pull request #316261 from microsoft/benibenj/scornful-donkey
benibenj May 13, 2026
3a58860
run_in_terminal: promote sync command to background after idle silenc…
meganrogge May 13, 2026
bc33377
run_in_terminal: fix zsh pitfalls with shell options and steering tex…
meganrogge May 13, 2026
d6576bc
Remove model picker category (#316280)
lramos15 May 13, 2026
9df8712
chore: run npm audit fix (#316150)
rzhao271 May 13, 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
76 changes: 76 additions & 0 deletions .github/instructions/sessions.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,76 @@ When working on files under `src/vs/sessions/`, use these skills for detailed gu

- **`sessions`** skill — covers the full architecture: layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines

## Architecture at a Glance

```
vs/sessions (Agents Window) ← this layer
↓ imports from
vs/workbench ← standard VS Code
vs/editor → vs/platform → vs/base
```

**Layer rule:** `vs/sessions` imports from `vs/workbench` and below. `vs/workbench` must **never** import from `vs/sessions`.

**Internal layers** (see `src/vs/sessions/LAYERS.md`):
```
Entry Points → contrib/* / contrib/providers/* / services/* → browser/ & common/ (core)
```

**Key constraint:** `contrib/*` must NOT import from `contrib/providers/*`. Providers are the most permissive contrib layer and may import from non-provider contribs, services, core, and sibling providers.

## Core Services

| Service | Interface file | Purpose |
|---------|---------------|---------|
| `ISessionsManagementService` | `services/sessions/common/sessionsManagement.ts` | Active session tracking, navigation, CRUD operations |
| `ISessionsProvidersService` | `services/sessions/common/sessionsProvider.ts` | Provider registry (register/unregister/lookup) |
| `ISession` / `IChat` | `services/sessions/common/session.ts` | Session and chat data interfaces with observable properties |

## Key Development Patterns

### Registering Contributions

All features register through the contribution model and must be imported in entry points:
- `sessions.common.main.ts` — cross-platform contributions
- `sessions.desktop.main.ts` — desktop/Electron-specific
- `sessions.web.main.ts` — web-specific

### Menu Registration

Always use `Menus.*` from `browser/menus.ts` — never `MenuId.*` from `vs/platform/actions`:
- `Menus.TitleBarLeftLayout` / `Menus.TitleBarRightLayout` — titlebar actions
- `Menus.SidebarTitle` — sidebar header actions
- `Menus.AuxiliaryBarTitle` — auxiliary bar header actions
- `Menus.ChatBarTitle` — chat bar header actions

### Context Keys

All sessions-specific context keys live in `common/contextkeys.ts`:
- `IsNewChatSessionContext` — whether showing the new session view
- `ActiveSessionProviderIdContext` — which provider owns the active session
- `ActiveSessionTypeContext` — session type of the active session
- `IsPhoneLayoutContext` — whether in phone layout mode
- `ChatBarVisibleContext` / `ChatBarFocusContext` — chat bar state

### Observable Patterns

```typescript
// Subscribe to session state changes
this._register(autorun(reader => {
const session = this.sessionsManagementService.activeSession.read(reader);
const title = session?.title.read(reader);
// React to changes
}));

// Batch updates
transaction(tx => {
this._title.set(newTitle, tx);
this._status.set(newStatus, tx);
});
```

## Mobile Component Architecture

The Agents window has an established mobile architecture (documented in `src/vs/sessions/MOBILE.md`). When adding phone-specific UI — bottom sheets, action sheets, mobile pickers, or any interaction that differs from desktop — follow these rules:
Expand All @@ -34,3 +104,9 @@ The Agents window can run on touch-capable platforms (notably iOS). Follow these
- Do not use `EventType.MOUSE_DOWN`, `EventType.MOUSE_UP`, or `EventType.MOUSE_MOVE` with `addDisposableListener` directly — on iOS, these events don't fire because the platform uses pointer events. Use `addDisposableGenericMouseDownListener`, `addDisposableGenericMouseUpListener`, or `addDisposableGenericMouseMoveListener` instead, which automatically select the correct event type per platform.
- For custom clickable elements (e.g. picker triggers, title bar pills, or other `<div>`/`<span>` elements styled as buttons) that open pickers or menus on click, listen to **both** `EventType.CLICK` and `TouchEventType.Tap` and call `Gesture.addTarget` on the element. On touch devices, including iOS, VS Code relies on the gesture system to emit `TouchEventType.Tap`, and `EventType.CLICK` alone may not reliably fire there. The base `Button` class already does this correctly, so this rule applies to custom non-`<button>` trigger elements.
- Add `touch-action: manipulation` in CSS on custom clickable elements (e.g. picker triggers, title bar pills, or other `<div>`/`<span>` elements styled as buttons) to eliminate the 300ms tap delay on touch devices. This is not needed for native `<button>` elements or standard VS Code widgets (quick picks, context menus, action bar items) which already handle touch behavior.

## Learnings

- Always check `src/vs/sessions/LAYERS.md` before adding cross-module imports — layering violations are enforced by ESLint and will fail CI.
- When creating new views, remember to import the contribution in the entry point — missing this causes the view to not appear.
- Session state flows through observables, not events. If you find yourself adding `onDid*` events for session state, convert to `IObservable` instead.
77 changes: 24 additions & 53 deletions .github/skills/sessions/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,38 @@ name: sessions
description: Agents window architecture — covers the agents-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agents window.
---

When working on the Agents window (`src/vs/sessions/`), always read the relevant specification document before making changes. If you modify the implementation, you **must** update the corresponding spec to keep it in sync.
## Before Making Any Changes

## Specification Documents

| Document | Path | Covers |
|----------|------|--------|
| Overview | `src/vs/sessions/README.md` | Architecture overview, folder conventions |
| Layer rules | `src/vs/sessions/LAYERS.md` | Import restriction rules for all sessions layers (enforced by ESLint) |
| Layout spec | `src/vs/sessions/LAYOUT.md` | Grid structure, parts, titlebar, per-session layout state, CSS |
| Mobile spec | `src/vs/sessions/MOBILE.md` | Mobile component architecture, phone-specific UI patterns |
| Sessions spec | `src/vs/sessions/SESSIONS.md` | Sessions architecture — layers, provider model, core interfaces, data flow |
| AI Customizations | `src/vs/sessions/AI_CUSTOMIZATIONS.md` | AI customization editor and tree view design |

## Engineering Principles

### Layering and Dependencies

- **Respect the layer hierarchy.** `vs/sessions` sits above `vs/workbench` — it may import from workbench and below, but workbench must never import from sessions. See `LAYERS.md` for the full internal layer rules.
- **Keep providers isolated.** Session providers (`contrib/providers/*`) are implementation details of specific backends. Non-provider contributions (`contrib/*`) must not import from providers — extract shared symbols to `services/` or `common/` instead.
- **Validate layers before committing.** Run `npm run valid-layers-check` to catch violations. Run `npm run compile-check-ts-native` for TypeScript errors — never use raw `tsc`.

### Separation of Concerns

- **Use the contribution model.** Features register through `registerWorkbenchContribution2` and `registerAction2`, imported by entry points (`sessions.common.main.ts`, `sessions.desktop.main.ts`). Don't wire features directly into core workbench code.
- **Prefer composition over modification.** Extend existing classes (e.g., `AgentSessionsChatWidget` wraps `ChatWidget`) rather than modifying shared workbench components. This keeps the sessions layer decoupled.
- **Use services for cross-cutting concerns.** Shared state belongs in services (`ISessionsManagementService`, `ISessionsProvidersService`), not passed through component hierarchies. Declare service dependencies in constructors via dependency injection.
**MANDATORY:** Before writing or modifying any code in `src/vs/sessions/`, you **must** read these documents:

### Reactive State and Observables
1. **`.github/instructions/coding-guidelines.instructions.md`** — Naming conventions, code style, string localization, disposable management, and DI patterns.
2. **`.github/instructions/source-code-organization.instructions.md`** — Layers, target environments, dependency injection, and folder structure conventions.

- **Expose mutable state as observables.** Session properties (`title`, `status`, `changes`, etc.) use `IObservable` for reactive UI binding. Use `observableValue`, `derived`, and `autorun` — not events — for state that drives UI updates.
- **Batch related state changes in transactions.** When updating multiple observables together, wrap in `transaction(tx => { ... })` to avoid intermediate renders.
Then read the relevant spec for the area you are changing (see table below). If you modify the implementation, you **must** update the corresponding spec to keep it in sync.

### Window Isolation

- **Scope registrations to the Agents window.** Views and contributions that should not appear in regular VS Code use `WindowVisibility.Sessions` in their registration.
- **Use dedicated menu IDs.** The Agents window defines its own menus in `browser/menus.ts` (`Menus.*`). Never use shared `MenuId.*` constants for Agents window UI.
- **Use dedicated storage keys.** Prefix with `workbench.agentsession.*` or `workbench.chatbar.*` to avoid conflicts with regular workbench state.

### Layout Stability

- **Maintain fixed positions.** The Agents layout is intentionally non-configurable — no settings-based position customization. New parts go in the right section of the grid.
- **Preserve no-op stubs.** Unsupported workbench features (zen mode, centered layout, etc.) remain as no-ops — never throw errors for unsupported API calls.
- **Manage pane composite lifecycle.** When toggling part visibility, always manage the associated pane composites (open default view container on show, dispose on hide).

### Code Organization

- **Core** (layout, parts, shell services) → `browser/`
- **Feature contributions** (views, actions, editors) → `contrib/<featureName>/browser/`
- **Session providers** (compute backends) → `contrib/providers/<providerName>/`
- **Shared service interfaces** → `services/<serviceName>/common/`
## Specification Documents

## General VS Code Guidelines
| Document | Path | When to read |
|----------|------|-------------|
| Layer rules | `src/vs/sessions/LAYERS.md` | Before adding any cross-module imports. Defines the internal layer hierarchy (`core` → `services` → `contrib` → `providers`) with ESLint-enforced import restrictions. Key rule: `contrib/*` must NOT import from `contrib/providers/*`. |
| Layout spec | `src/vs/sessions/LAYOUT.md` | Before changing any part, grid structure, titlebar, or CSS. Documents the fixed grid layout (Sidebar \| ChatBar \| AuxiliaryBar), part positions, the modal editor system, per-session layout state persistence, and the titlebar's three-section design. |
| Sessions spec | `src/vs/sessions/SESSIONS.md` | Before changing session/provider interfaces or data flow. Covers the pluggable provider model (`ISessionsProvider` → `ISessionsProvidersService` → `ISessionsManagementService`), `ISession`/`IChat` interfaces, observable state propagation, workspace/folder model, and session type system. |
| Sessions list spec | `src/vs/sessions/SESSIONS_LIST.md` | Before changing the sessions sidebar list. Covers the tree widget (`WorkbenchObjectTree`), renderers, grouping (workspace/date), filtering (type/status/archived/read), pinning, read/unread state, workspace capping, mobile adaptations, storage keys, and registered actions. |
| Mobile spec | `src/vs/sessions/MOBILE.md` | Before adding any phone-specific UI. Covers the mobile part subclass architecture, viewport classification (phone < 640px), `MobileTitlebarPart`, drawer-based sidebar, `MobilePickerSheet`, view/action gating with `IsPhoneLayoutContext`, and the desktop → mobile component mapping. |
| AI Customizations | `src/vs/sessions/AI_CUSTOMIZATIONS.md` | Before working on the customization editor or tree view. Documents the management editor (in `vs/workbench`) and the tree view/overview (in `vs/sessions/contrib/aiCustomizationTreeView`). |

The Agents window follows all standard VS Code engineering practices. See these instruction files for the full rules:
## Common Pitfalls

- **Source Code Organization** — `.github/instructions/source-code-organization.instructions.md` (layers, target environments, DI, contribution rules)
- **Coding Guidelines** — `.github/instructions/coding-guidelines.instructions.md` (naming conventions, code style, string localization, disposable management, DI patterns)
- **Writing Tests** — `.github/instructions/writing-tests.instructions.md` (unit/integration tests, `ensureNoDisposablesAreLeakedInTestSuite`, snapshot testing, clean teardown)
- **Wrong menu IDs**: Never use `MenuId.*` from `vs/platform/actions` for Agents window UI. Always use `Menus.*` from `browser/menus.ts`.
- **Events instead of observables**: Session state must flow through `IObservable`, not `Event`. Use `autorun`/`derived` for reactive UI, not `onDid*` event listeners.
- **Importing from providers**: Non-provider `contrib/*` code must never import from `contrib/providers/*`. Extract shared interfaces to `services/` or `common/`.
- **Missing entry point import**: New contribution files must be imported in the appropriate `sessions.*.main.ts` entry point to be loaded (for example `sessions.common.main.ts`, `sessions.desktop.main.ts`, `sessions.web.main.ts`, or `sessions.web.main.internal.ts`).
- **Modifying workbench code**: Prefer extending/wrapping workbench classes in the sessions layer over modifying shared workbench components.

## Validating Changes

You **must** run these checks before declaring work complete:

1. `npm run compile-check-ts-native` — TypeScript compilation check. **Do not run `tsc` directly.**
2. `npm run valid-layers-check` — layering violations (see `LAYERS.md`)
3. `scripts/test.sh --grep <pattern>` — unit tests (see Writing Tests instructions)
2. `npm run valid-layers-check` — **MANDATORY.** Catches layering violations. If this fails, fix the imports before proceeding.
3. `scripts/test.sh --grep <pattern>` — unit tests for affected areas
6 changes: 3 additions & 3 deletions build/rspack/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions extensions/copilot/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions extensions/copilot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "AI chat features powered by Copilot",
"version": "0.49.0",
"build": "1",
"internalAIKey": "1058ec22-3c95-4951-8443-f26c1f325911",
"completionsCoreVersion": "1.378.1799",
"internalLargeStorageAriaKey": "ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",
"ariaKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
Expand Down Expand Up @@ -6708,7 +6707,7 @@
"@anthropic-ai/claude-agent-sdk": "0.2.112",
"@anthropic-ai/sdk": "^0.82.0",
"@github/blackbird-external-ingest-utils": "^0.3.0",
"@github/copilot": "^1.0.39",
"@github/copilot": "1.0.39",
"@google/genai": "^1.22.0",
"@humanwhocodes/gitignore-to-minimatch": "1.0.2",
"@microsoft/tiktokenizer": "^1.0.10",
Expand Down
Loading
Loading