Commit Graph

6455 Commits

Author SHA1 Message Date
Henning Dieterichs
b533ee4b6e Updates component explorer & adopts rspack for fixture serving (#306484) 2026-04-01 03:25:14 +00:00
Josh Spicer
fcbabe4c73 Merge extension-provided policy (#306874)
* Add merge script for extension configuration policies from distro

Adds build/lib/policies/mergeExtensionPolicies.ts which fetches the
distro's product.json (at the commit pinned in package.json) and merges
extensionConfigurationPolicy entries into policyData.jsonc.

The --export-policy-data step only captures policies from the OSS
configuration registry. Extension policies (e.g., Copilot settings)
are defined in vscode-distro's product.json and are not available in
the OSS dev build. This merge script bridges that gap.

Workflow: ./scripts/code.sh --export-policy-data && node build/lib/policies/mergeExtensionPolicies.ts

Also updates:
- policyExport integration test to run the merge step
- add-policy skill documentation with extension policy lifecycle

* Simplify extension policy format: drop localization block from distro

- mergeExtensionPolicies.ts now reads only description/category from
  the distro and synthesizes localization key/value pairs internally
- Integration test gracefully skips merge step when distro is unavailable
- Updated SKILL.md to document the simplified distro format

* docs: use gh auth token in policy export command

* Handle old distro format missing description/category fields

* docs: add troubleshooting section for merge step in policy skill

* Require description and category fields in extension policy entries

* Add extension configuration policies to policyData.jsonc

* Address PR feedback: fix disclaimer, log targetPath, strip GITHUB_TOKEN from test

* fix: revert extension policies from policyData.jsonc, remove console.log from test

Extension policies should only be added after the distro PR merges.
Test runner disallows console output in tests.

* Add mock distro test for mergeExtensionPolicies, remove merge from export test

- mergeExtensionPolicies.ts: add DISTRO_PRODUCT_JSON env var to
  override the distro path (for testing without private repo access)
- New test: creates a mock product.json, runs the merge script,
  verifies policies are added correctly and idempotently
- Export test: no longer runs the merge step (avoids needing
  distro access or GITHUB_TOKEN in CI)

* Update distro and regenerate policyData.jsonc with extension policies

* Fix CI: add extension policy fixture for export test

The export test now runs mergeExtensionPolicies using a checked-in
fixture file instead of requiring distro access or GITHUB_TOKEN.
When extension policies change in the distro, regenerate both
policyData.jsonc and the fixture file.

* Integrate extension policy merge into --export-policy-data

- Removed mergeExtensionPolicies.ts — no separate CLI tool needed
- --export-policy-data now reads build/lib/policies/extensionPolicies.json
  and merges extension policies into the output automatically
- Single command workflow: ./scripts/code.sh --export-policy-data
- Simplified test — no merge step, no GITHUB_TOKEN, no distro access
- Updated SKILL.md to document the simplified workflow

* Dynamic distro reading: --export-policy-data fetches from distro directly

- policyExport.contribution.ts reads distro product.json dynamically:
  1. DISTRO_PRODUCT_JSON env var (for testing)
  2. .build/distro/mixin/stable/product.json (local checkout)
  3. GitHub API with GITHUB_TOKEN (remote fetch)
- New scripts/export-policy-data.sh wrapper: sets up GITHUB_TOKEN
  via gh CLI and runs the export
- Deleted build/lib/policies/extensionPolicies.json (no static copy)
- Test uses DISTRO_PRODUCT_JSON with a fixture file
- Uses sandbox process.env and VSBuffer (renderer-safe)

* Replace bash wrapper with cross-platform TS script

- New build/lib/policies/exportPolicyData.ts: handles transpilation,
  GITHUB_TOKEN setup via gh CLI, and runs --export-policy-data
- Added 'npm run export-policy-data' script to package.json
- Removed scripts/export-policy-data.sh
- Updated SKILL.md and test error message

* Use OAuth device flow for GitHub token acquisition

exportPolicyData.ts now acquires tokens via:
1. GITHUB_TOKEN env var (if set)
2. gh CLI (fast, non-interactive)
3. GitHub OAuth device flow (interactive, no dependencies)

Based on vscode-copilot-chat's getToken.mts pattern.

* Fix error messages to reference npm run export-policy-data

* Fix disclaimer to reference npm run export-policy-data, clean up stale refs

* Clarify test fixture is static and not expected to track distro changes

* Add inline comment in test clarifying fixture is static

* SKILL.md: add step to update distro commit hash in package.json

* Remove inline comment per PR feedback

* Remove local .build/distro/ fallback path per PR feedback
2026-04-01 00:07:47 +00:00
Dmitriy Vasyura
3d91bf7907 Enable CLI DevTunnel sanity tests (#305807) 2026-03-31 14:13:23 +11:00
Raymond Zhao
c1f3775929 chore: run npm audit fix (#306509) 2026-03-30 16:32:21 -07:00
dependabot[bot]
33250873ec build(deps): bump picomatch from 2.3.1 to 2.3.2 in /build (#306399)
Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 23:25:51 +00:00
Robo
d11c632ba8 chore: update electron@39.8.5 (#306292)
* chore: update electron@39.8.5

* chore: bump distro
2026-03-30 11:13:12 +00:00
Robo
4927766313 chore: add srt sandbox dependencies to deb and rpm (#297819)
* chore: add srt sandbox dependencies to deb and rpm

* fix: move the depedency to recommends
2026-03-30 18:29:20 +09:00
Benjamin Pasero
1bff585f1a debt - fix regression with layer checker and DOM (#306119) 2026-03-29 18:13:02 +00:00
Benjamin Christopher Simmonds
a086290082 Merge pull request #305297 from microsoft/benibenj/automatic-tapir
Multi chat support
2026-03-26 23:26:28 +01:00
dependabot[bot]
ca702223ea Bump picomatch from 4.0.2 to 4.0.4 in /build/npm/gyp (#304913)
Bumps [picomatch](https://github.com/micromatch/picomatch) from 4.0.2 to 4.0.4.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/4.0.2...4.0.4)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2026-03-26 14:45:21 -07:00
BeniBenj
c09783b1e0 multi chat support 2026-03-26 21:34:15 +01:00
Sandeep Somavarapu
d466d7d67b sessions: Extensible sessions provider architecture and ISessionData migration (#304626)
* Add session provider interfaces and menu contributions for new session management

* Add DefaultCopilotChatSessionsProvider implementation

Implements ISessionsProvider for the default Copilot session types (CLI and Cloud).
Wraps existing IAgentSessionsService with AgentSessionAdapter that maps
IAgentSession to the new ISessionData interface with observables.

Includes workspace browsing (folder dialog + repo command), session listing,
and session actions (archive, delete, rename) that delegate to underlying services.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate WorkspacePicker to use sessions provider registry

Browse actions (Browse Folders, Browse Repositories, Browse Remotes) are now
sourced from registered ISessionsProvider instances instead of being hardcoded.
Removed direct dependencies on IFileDialogService, ICommandService,
IRemoteAgentHostService, and IQuickInputService — those are now encapsulated
in the provider's browseActions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate NewChatWidget to use sessions provider registry

Replace hardcoded session type inference (isFolder→Background, isRepo→Cloud,
isRemoteAgentHost→dynamic) with provider registry lookup via
ISessionsProvidersService.getProvidersForWorkspace().

Removed dependencies on IRemoteAgentHostService and
getRemoteAgentHostSessionTarget — target resolution is now the provider's
responsibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Replace instanceof picker rendering with declarative pickerVisibility

Add INewSessionPickerVisibility to INewSession interface — each session
implementation declares which pickers should be visible (localModel,
cloudModel, mode, permission, isolation, branch, hasToolbarOptionGroups).

NewChatWidget._setNewSession() now calls a single _renderSessionPickers()
that reads pickerVisibility instead of using instanceof checks against
AgentHostNewSession/RemoteNewSession/CopilotCLISession.

Removed the three type-specific methods:
- _renderAgentHostSessionPickers()
- _renderLocalSessionPickers()
- _renderRemoteSessionPickers()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate SessionsManagementService factory to use provider registry

Replace hardcoded if/else chain in createNewSessionForTarget() with a
provider registry lookup. The service now finds the provider that handles
the requested target type and delegates session creation to it.

Removed direct imports of CopilotCLISession, RemoteNewSession, and
AgentHostNewSession — the factory no longer needs to know about concrete
session implementations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Register isolation and branch pickers as menu actions via IActionViewItemService

DefaultCopilotChatSessionsProvider.registerMenuContributions() now:
- Registers Action2 entries for isolation and branch pickers into
  Menus.NewSessionRepositoryConfig with when: IsActiveSessionBackgroundProviderContext
- Registers IActionViewItemService factories that create the picker widgets
  as BaseActionViewItem wrappers

This enables a MenuWorkbenchToolBar to render the pickers automatically,
with visibility controlled by context keys rather than instanceof checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove empty leftover files from previous refactoring

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make IsolationPicker session-aware via ISessionsManagementService

IsolationPicker now observes the active session to determine git repo
availability instead of relying on the widget to call setHasGitRepo().
Removed setVisible() — visibility is self-managed based on internal state
(hasGitRepo + isolationOptionEnabled). The picker still fires onDidChange
for the widget to push isolation mode to INewSession.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove widget orchestration of IsolationPicker visibility

IsolationPicker now self-manages visibility by observing the active session.
Removed all setVisible() and setHasGitRepo() calls from NewChatWidget —
the picker handles these internally.

The picker still fires onDidChange so the widget can push isolation mode
to INewSession.setIsolationMode().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make BranchPicker session-aware via ISessionsManagementService

BranchPicker now observes the active session to get the project's repository
and loads branches automatically. Self-manages visibility based on repository
availability. Removed setRepository() and setVisible() — the picker handles
these internally.

Removed all setRepository/setVisible calls from NewChatWidget for both
isolation and branch pickers. The widget only listens to their onDidChange
events to push state to INewSession.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make Mode and Permission pickers session-aware

ModePicker and PermissionPicker now observe ISessionsManagementService.newSession
to self-manage visibility based on the session's pickerVisibility.
ModePicker pushes mode to the session directly via its autorun.

Added newSession observable to ISessionsManagementService so pickers can
observe the current new session being configured.

Updated IsolationPicker and BranchPicker to use the new newSession observable
instead of the previous hack with private field access.

Removed all setVisible() calls for mode and permission pickers from
NewChatWidget — they are now fully self-managing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make model pickers session-aware

CloudModelPicker now observes ISessionsManagementService.newSession to
self-manage visibility and session binding. Removed setVisible() and
manual setSession() calls from NewChatWidget.

Local model picker container visibility now driven by autorun observing
newSession.pickerVisibility.localModel instead of _renderSessionPickers.

_renderSessionPickers is now minimal — only handles extension-driven
toolbar pickers and git repo opening.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move git repo resolution to DefaultCopilotChatSessionsProvider

Git repository opening is now the provider's responsibility. When creating
a CLI session with a folder workspace, the provider resolves the git repo
and attaches it to the session's project. Pickers observe the session and
react automatically.

Removed _openRepository(), _repositoryLoading, _openRepositoryCts, and
IGitService dependency from NewChatWidget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Unify session interface: ISessionData replaces INewSession on public surface

ISessionsProvider.createNewSession() now returns ISessionData instead of
INewSession. Added setSessionOption(sessionId, key, value) for pickers
to write through the provider.

Extended ISessionData with:
- SessionStatus.Configuring for pre-send phase
- ISessionPickerVisibility for UI picker control
- workspace as IObservable (changes during configuration)

INewSession becomes provider-internal — not exposed on any service interface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Implement ISessionData in DefaultCopilotChatSessionsProvider

createNewSession() now returns ISessionData via NewSessionDataAdapter
which wraps INewSession internally. setSessionOption() routes option
changes to the underlying INewSession.

AgentSessionAdapter updated to match new ISessionData interface
(workspace as observable, pickerVisibility).

INewSession is now fully internal to the provider — not exposed
on any public interface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Switch all pickers to ISessionsProvidersService

All pickers now observe ISessionsProvidersService.activeSession (ISessionData)
instead of ISessionsManagementService.newSession (INewSession).

ModePicker uses sessionsProvidersService.setSessionOption() to push mode.
IsolationPicker reads workspace.repositories from ISessionData.
PermissionPicker and CloudModelPicker observe activeSession.pickerVisibility.

Removed newSession observable from ISessionsManagementService interface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add new session provider service interfaces

* Move extension toolbar pickers to self-contained ExtensionToolbarPickers

Created ExtensionToolbarPickers class that observes ISessionsProvidersService
activeSession and dynamically renders extension-driven option group pickers
(ChatSessionPickerActionItem / SearchableOptionPickerActionItem) for Cloud
sessions.

Removed ~120 lines from NewChatWidget:
- _renderSessionPickers(), _renderToolbarPickers(), _renderToolbarPickerWidget()
- _clearToolbarPickers(), _clearAllPickers()
- _updateOptionContextKey(), _getOrCreateOptionEmitter()
- _toolbarPickerWidgets, _toolbarPickerDisposables, _optionEmitters, _optionContextKeys

NewChatWidget now has zero picker rendering logic — all pickers are
self-managing via session observation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refine interfaces: remove pickerVisibility, canHandle, setSessionOption

Addressed design feedback:
- SessionStatus: renamed Configuring→Untitled, added InProgress and NeedsInput
- Removed ISessionPickerVisibility from ISessionData — pickers use menu
  when-clauses, not session-declared visibility
- Removed canHandle() from ISessionsProvider — workspace→provider mapping
  is implicit via browse actions
- Removed setSessionOption() — provider-internal wiring, not public API
- Removed registerMenuContributions() — providers register contributions
  statically via workbench contributions
- Removed NewSessions.WorkspaceMenu — workspace picker is a fixed widget
- Added getSessionTypesForWorkspace() to ISessionsProvidersService — the
  session type selector is a fixed picker that queries this

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate sidebar and title bar to use ISessionsProvidersService

Title bar:
- Added ISessionsProvidersService injection
- _getActiveSessionLabel() prefers ISessionData.title from providers service
- _getActiveSessionIcon() prefers ISessionData.icon from providers service
- _getRepositoryLabel() prefers ISessionData.workspace.label from providers service
- Added autorun on sessionsProvidersService.activeSession for re-rendering
- Falls back to legacy ISessionsManagementService path when ISessionData unavailable

Sidebar:
- Added ISessionsProvidersService injection
- allowedProviders now derived from registered providers' session types
  instead of hardcoded [Background, Cloud]
- Removed hardcoded overrideExclude and providerLabelOverrides
- Removed AgentSessionProviders and isAgentHostTarget imports

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move activeSession to ISessionsManagementService, remove from ISessionsProvidersService

Added activeSessionData: IObservable<ISessionData> to ISessionsManagementService.
Deprecated activeSession (IActiveSessionItem) — use activeSessionData instead.

Removed activeSession and openSession from ISessionsProvidersService — it's
a registry/aggregator, not a session state manager.

Title bar now reads from activeSessionService.activeSessionData instead of
sessionsProvidersService.activeSession. Removed ISessionsProvidersService
dependency from title bar.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove visibility management from all pickers

Pickers are now dumb widgets — they render and handle interaction only.
Visibility is controlled by context keys and menu when-clauses, not by
autorun blocks toggling display:none.

Removed from all pickers:
- autorun blocks observing activeSession/newSession for visibility
- _updateVisibility() methods
- ISessionsProvidersService dependencies (no longer needed)

Pickers affected: ModePicker, PermissionPicker, IsolationPicker,
BranchPicker, CloudModelPicker, local model picker container.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move menu registrations to static scope, clean up empty files

Action2 registrations (isolation/branch pickers) are now at module scope
instead of inside registerMenuContributions(). IActionViewItemService
registrations moved to the provider's constructor.

Removed registerMenuContributions() method — it was no longer on the
ISessionsProvider interface and wasn't called.

Deleted recreated empty files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add new sessions provider and service interfaces

* Implement ISessionsProvider for RemoteAgentHost

Created RemoteAgentHostSessionsProvider that implements ISessionsProvider
for each agent on a remote agent host connection. Provides:
- Session type: remote-{authority}-{provider}
- Browse action: remote FS folder dialog
- Session creation returning ISessionData

RemoteAgentHostContribution now registers a RemoteAgentHostSessionsProvider
per-agent via ISessionsProvidersService.registerProvider(), alongside the
existing IChatSessionsService registrations. Provider lifecycle is managed
by the agent store — automatically disposed when the agent disconnects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix all TypeScript compilation errors

Fixed across 9 files:
- Removed unused imports, fields, and methods
- Fixed SessionStatus enum references (Configuring→Untitled, Active→InProgress)
- Fixed ISessionsProvidersService.activeSession removal (use ISessionsManagementService)
- Fixed getProvidersForWorkspace→getSessionTypesForWorkspace
- Removed ISessionData.setProject call (provider-internal)
- Cast allowedProviders to AgentSessionProviders[]
- Removed ISessionPickerVisibility references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Register DefaultCopilotChatSessionsProvider via workbench contribution

The provider was defined but never registered with ISessionsProvidersService.
Added DefaultSessionsProviderContribution that instantiates and registers
the provider at WorkbenchPhase.AfterRestored.

This fixes the missing browse actions in the workspace picker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix model picker visibility: local and cloud are mutually exclusive

Both model pickers were visible because visibility management was removed
but they aren't menu-contributed yet. Added autorun in NewChatWidget that
observes the active session's pickerVisibility to toggle local vs cloud
model picker. Restored setVisible() on CloudModelPicker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Register model pickers as menu actions with context-key visibility

Local model picker and cloud model picker are now registered as Action2
entries in NewSessions.SessionConfigMenu with when-clauses:
- Local model: when isActiveSessionBackgroundProvider

IActionViewItemService factories registered for the cloud model picker.
Model picker visibility in NewChatWidget now driven by sessionType check
instead of pickerVisibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix model picker visibility: use sessionsManagementService for session creation

_createNewSession now routes through sessionsManagementService.createNewSessionForTarget
which properly sets activeSessionData, context keys (isActiveSessionBackgroundProvider),
and the _newSession observable. This fixes the model picker not showing because
activeSessionData was never set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix model picker not showing on reload

Default to showing local model picker when activeSessionData is undefined
(startup/reload). The default session type is CLI, so local model picker
should be visible until a Cloud session is explicitly created.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix session type resolution for different workspace types

Repo workspaces should create Cloud sessions, local folders should create
CLI sessions. The previous getSessionTypesForWorkspace returned all types
without filtering by workspace. Restored workspace-type-based inference
in _createNewSession until workspace picker stores providerId.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Hide permissions picker for Cloud sessions

Permissions picker visibility now tied to session type — only shown for
CLI (Background) sessions. Added autorun and menu action registration
with when: IsActiveSessionBackgroundProviderContext.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix permissions picker: use autorun on activeSessionData for visibility

Permissions picker is still widget-owned (needed for reading permissionLevel
at send time). Visibility controlled by observing activeSessionData.sessionType
— only shown for CLI (Background) sessions.

Menu action + IActionViewItemService registration added for future transition
to fully menu-driven rendering once permission state is on ISessionData.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move permissionLevel to ISessionData, render via MenuWorkbenchToolBar

permissionLevel is now on ISessionData as an IObservable<ChatPermissionLevel>.
NewChatPermissionPicker writes to activeSessionData.permissionLevel when
the user changes the level. sendRequestForNewSession reads it from
activeSessionData instead of a widget-owned picker.

Permissions picker is now rendered via MenuWorkbenchToolBar for
NewSessions.SessionControlMenu — visibility controlled by
IsActiveSessionBackgroundProviderContext context key.

Removed _permissionPicker from NewChatWidget entirely.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix permissions picker: use 'navigation' group for inline rendering

MenuWorkbenchToolBar only renders items in the 'navigation' group inline.
Items in other groups go to the overflow menu. Changed permissions picker
action from group 'permissions' to group 'navigation'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix startup race: wait for providers before creating initial session

On reload, the widget renders before DefaultCopilotChatSessionsProvider
is registered (AfterRestored phase). The initial session creation now
waits for onDidChangeProviders if no providers are available yet.

This fixes wrong pickers showing on reload (CLI pickers for a Cloud
session because the provider wasn't found).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Hide mode picker for Cloud sessions

Mode picker visibility now tied to activeSessionData.sessionType —
only shown for CLI (Background) sessions, hidden for Cloud.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Render mode and model pickers via MenuWorkbenchToolBar

Mode, local model, and cloud model pickers are now rendered via
MenuWorkbenchToolBar for NewSessions.SessionConfigMenu. Visibility
controlled by context keys:
- Mode + local model: when isActiveSessionBackgroundProvider

All registered with 'navigation' group for inline rendering.
IActionViewItemService factories create the picker widgets with
full DI (ILanguageModelsService for model list, etc.).

Removed autoruns for model/mode visibility from NewChatWidget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove dead model/mode picker code from newChatViewPane

Mode and model pickers are now created by the sessions provider's
IActionViewItemService factory and rendered by a MenuWorkbenchToolBar.
The widget no longer needs to own these pickers.

Removed:
- _currentLanguageModel, _modelPickerDisposable, _localModelPickerContainer fields
- _cloudModelPicker, _modePicker fields and their instantiation
- _modePicker.onDidChange listener
- _initDefaultModel() calls
- _currentLanguageModel.read(reader) autorun
- Model set block in _setNewSession
- Model restoration block in _restoreState
- Unused imports: IModelPickerDelegate, EnhancedModelPickerActionItem,
  IChatInputPickerOptions, CloudModelPicker, ModePicker,
  ILanguageModelChatMetadataAndIdentifier, ILanguageModelsService,
  observableValue, autorun

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix model picker showing 'Auto': initialize with default model on load

The IActionViewItemService factory creates the model picker with an empty
currentModel observable. If models aren't loaded yet, it shows 'Auto'.
Now listens for onDidChangeLanguageModels and sets the first available
model as default when models become available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove setVisible from CloudModelPicker — visibility is menu-driven

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align model picker styling with other session pickers

Updated .sessions-chat-model-picker CSS to match .sessions-chat-picker-slot:
- font-size: 12px → 13px
- padding: 3px 6px → 3px 3px 3px 6px
- codicon: 12px → 14px (with flex-shrink: 0)
- Added chevron-down specific sizing (12px, margin-left: 6px)
- Added hover color change, overflow handling, white-space: nowrap

All pickers now share the same visual treatment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Style config toolbar to match session picker visuals

Updated CSS to target .sessions-chat-config-toolbar (the MenuWorkbenchToolBar
container for mode + model pickers) instead of .sessions-chat-model-picker.
Styles match .sessions-chat-picker-slot for consistent look across all pickers.

Also styles the .monaco-toolbar and .action-item within the config toolbar
to align properly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Disable model picker until models are available

The model picker action starts with enabled=false if no models are loaded
yet. When onDidChangeLanguageModels fires and models become available,
it sets enabled=true and selects the first model.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert "Disable model picker until models are available"

This reverts commit 80c5d5e595.

* Hide isolation picker when isolation setting is disabled

Added config-based context key check to the isolation picker's when clause:
config.github.copilot.chat.cli.isolationOption.enabled must not be false.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify isolation config check: use ContextKeyExpr.has()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix compilation: add permissionLevel field declarations to NewSessionDataAdapter

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix isolation/branch picker: use 'navigation' group and equals() for config

- Changed group from 'isolation'/'branch' to 'navigation' for inline rendering
- Changed ContextKeyExpr.has() to ContextKeyExpr.equals(..., true) since
  has() returns true when the config key exists even if value is false

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Replace manual isolation/branch render with MenuWorkbenchToolBar

Isolation and branch pickers were being rendered twice — once by the widget
manually and once by MenuWorkbenchToolBar via IActionViewItemService.
Removed the manual render, keeping only the MenuWorkbenchToolBar for
NewSessions.RepositoryConfigMenu.

Widget still holds _isolationPicker/_branchPicker for state reading
(selectedBranch, onDidChange events) until state moves to ISessionData.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add branch and isolationMode observables to ISessionData implementations

- Add _branch and _isolationMode observableValue fields to NewSessionDataAdapter,
  setting them in setOption() alongside forwarding to _newSession
- Add branch and isolationMode observableValue fields to AgentSessionAdapter
- Add branch and isolationMode to RemoteAgentHostSessionsProvider.createNewSession()
- Inject ISessionsManagementService into IsolationPicker and BranchPicker,
  writing to activeSessionData on selection via ISettableObservable cast
- Remove _branchPicker, _isolationPicker, and _branchLoading from NewChatWidget,
  reading branch from activeSessionData instead

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove permissionLevel, branch, isolationMode from ISessionData implementations

These fields are provider-internal state, not part of the common ISessionData
interface. Removed from AgentSessionAdapter and RemoteAgentHostSessionsProvider.
Kept on NewSessionDataAdapter as provider-internal fields. Updated
sessionsManagementService to access permissionLevel via cast since it's no
longer on the interface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add sessionWorkspaceHasRepository context key for picker visibility

DefaultCopilotChatSessionsProvider observes activeSessionData.workspace
and sets sessionWorkspaceHasRepository context key. Isolation and branch
picker when-clauses now require this key — they only show when a
repository is available in the active session's workspace.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix cyclic dependency: move sessionWorkspaceHasRepository to SessionsManagementService

SessionsManagementService now owns the sessionWorkspaceHasRepository
context key, observing activeSessionData.workspace via autorun.
Removed ISessionsManagementService dependency from DefaultCopilotChatSessionsProvider.

Cycle was: Provider → ManagementService → ProvidersService → Provider.
Now: ManagementService manages the context key independently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Propagate active session to owning provider for context keys

Flow: SessionsManagementService → ISessionsProvidersService.setActiveSession()
→ owning ISessionsProvider.setActiveSession() → provider sets context keys

DefaultCopilotChatSessionsProvider.setActiveSession() observes the session's
workspace and sets sessionWorkspaceHasRepository context key.

SessionsManagementService no longer manages hasRepository context key —
that's the provider's responsibility.

Added setActiveSession()/clearActiveSession() to ISessionsProvider and
ISessionsProvidersService interfaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Replace active session propagation with workbench contribution

Remove setActiveSession/clearActiveSession from ISessionsProvider interface,
ISessionsProvidersService interface, and their implementations in
SessionsProvidersService, DefaultCopilotChatSessionsProvider, and
RemoteAgentHostSessionsProvider.

Remove the autorun in SessionsManagementService that propagated active
session changes to providers.

Add DefaultCopilotActiveSessionContribution that observes the active
session directly and sets SessionWorkspaceHasRepositoryContext when the
active session belongs to the default-copilot provider.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix sessionWorkspaceHasRepository to check for git repo

Check repo.workingDirectory (set by git service) instead of just
repositories.length. A workspace can have a repository URI without
an actual git repo (e.g., GitHub remote file).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refactor: merge CopilotCLISession and RemoteNewSession with ISessionData

Move CopilotCLISession and RemoteNewSession from newSession.ts into
defaultCopilotSessionsProvider.ts and make them implement both INewSession
and ISessionData directly, eliminating the NewSessionDataAdapter wrapper.

- CopilotCLISession and RemoteNewSession now carry ISessionData fields
  (sessionId, providerId, title, status, workspace, changes, etc.)
  alongside their existing INewSession functionality
- Remove NewSessionDataAdapter class — no longer needed
- createNewSession() returns the session directly without wrapping
- setSessionOption() routes through setSessionDataOption() on the session
- Add ICopilotNewSessionData interface for type-safe access to
  provider-specific observable fields (branchObservable, isolationModeObservable,
  permissionLevel, hasGitRepo)
- Update extensionToolbarPickers.ts and modelPicker.ts to import
  RemoteNewSession from its new location
- Update sessionsManagementService.ts to extract INewSession directly
  from the session data (no more _newSession indirection)
- Keep INewSession interface and AgentHostNewSession in newSession.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove INewSession interface from the codebase

- Remove the exported INewSession interface from newSession.ts
- Remove 'implements INewSession' from AgentHostNewSession, CopilotCLISession,
  and RemoteNewSession classes
- Replace INewSession with file-local INewSessionConfig types in
  sessionsManagementService.ts and newChatViewPane.ts that capture only
  the configuration properties needed by each consumer
- Change createNewSessionForTarget return type from INewSession to ISessionData
- Change _newSessionObservable/newSession observable types to ISessionData
- Update ARCHITECTURE.md reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix: setProject now updates ISessionData workspace observable

CopilotCLISession.setProject() was only updating internal _project/_repoUri
fields but not the ISessionData.workspace observable. The
DefaultCopilotActiveSessionContribution couldn't detect workspace changes.

Now setProject() also updates _workspaceData so the workspace observable
reflects the current project.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move git repo resolution into CopilotCLISession

CopilotCLISession now resolves the git repository itself when setProject()
is called. Injects IGitService directly. Sets _hasGitRepo observable
based on whether gitService.openRepository() succeeds.

Removed _resolveGitRepository from DefaultCopilotChatSessionsProvider —
the session is self-contained. Removed IGitService from the provider.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move send flow to DefaultCopilotChatSessionsProvider

ISessionsProvider.sendRequest(sessionId) now owns the full send flow:
- Builds IChatSendRequestOptions from session internals
- Opens chat widget, sets permission level
- Loads session model with options
- Sends request via chatService
- Waits for agent session to appear
- Returns ISessionData

SessionsManagementService.sendRequestForNewSession() is now a thin
wrapper that delegates to sessionsProvidersService.sendRequest() and
sets the result as active session.

Removed ~120 lines from SessionsManagementService:
- doSendRequestForNewSession, openNewSession, loadNewSession
- loadProbableNewAgentSession, loadNewAgentSession
- INewSessionConfig interface

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix TypeScript compilation errors in sessionsManagementService

- Remove unused imports (Event, IDisposable, CancellationToken, etc.)
- Remove unused constructor services (uriIdentityService, chatSessionsService,
  chatWidgetService, chatService, languageModelsService, toolsService)
- Replace MutableDisposable<ISessionData> with plain field since ISessionData
  does not extend IDisposable
- Remove invalid setQuery call on ISessionData in createNewSessionForTarget
- Fix ISessionData branch in setActiveSession to use workspace.get() and
  sessionType instead of non-existent project, target, and onDidChange
- Remove unused DisposableStore and _newActiveSessionDisposables field

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refine sessions provider architecture — manual improvements

Major changes:
- SessionWorkspace simplified to URI scheme constants only (class removed)
- ISessionsProvider interface refined:
  - createNewSession(workspace) takes ISessionWorkspace directly
  - Added setSessionType(), getSessionTypes(), setModel()
  - sendRequest() takes ISendRequestOptions (query + attachedContext)
  - ISessionType gains requiresWorkspaceTrust
  - ISendRequestOptions introduced
- ISessionData extended with modelId, mode, loading observables
- DefaultCopilotChatSessionsProvider emptied (rebuilt separately)
- Picker files consolidated:
  - Deleted: folderPicker, workspacePicker, branchPicker, modePicker,
    modelPicker, sessionTargetPicker
  - New: sessionTypePicker, sessionWorkspacePicker
- NewChatWidget significantly simplified — uses ISessionData directly,
  removed INewSessionConfig
- SessionsManagementService cleaned up
- Title bar and sidebar updated
- Deleted obsolete test files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rewrite SessionsListControl with WorkbenchObjectTree

Replace WorkbenchList with WorkbenchObjectTree<SessionListItem, FuzzyScore>
for the sessions list. Sessions are now rendered in a proper tree hierarchy
with section headers as collapsible parent nodes.

Key changes:
- Tree widget: WorkbenchObjectTree with FuzzyScore filter data
- Data types: ISessionSection gains an id field; SessionListItem exported
- Session item renderer: Two-row layout with icon, title, workspace,
  diff stats (+N/-N), status description, and relative timestamp
- Section header renderer: Uppercase label with session count
- Grouping: By date (Today/Yesterday/This Week/Older) or repository
- Sorting: By created or updated timestamp descending
- Tree options: No indent guides, hidden twisties, identity provider
- CSS: New .sessions-list-control container, diff stat colors, separator
  dots between detail parts, hidden empty detail spans
- Public API preserved: ISessionsListControlOptions (with deprecated
  ISessionsListOptions alias), all existing control methods

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix session list rendering: inline details with dot separators

Rebuilt details row to dynamically create elements with · separator
spans between diff stats and timestamp. Removed the has-detail/display:none
approach — details row is cleared and rebuilt each render cycle.

Removed margin-left:auto from time element so it stays inline.
Removed unused workspace/description template fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix missing diff stats: handle summary changes format

AgentSession.changes can be a summary object { files, insertions, deletions }
instead of an array of IChatSessionFileChange. The _extractChanges method
now creates a synthetic entry from the summary so the renderer can show
+N -N diff statistics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix hidden diff stats: remove leftover has-detail CSS rules

The old CSS rules hid .session-diff, .session-time etc. without the
has-detail class. Since the renderer now creates elements dynamically
(without has-detail), these rules were hiding all detail content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align font styles with original agent sessions view

- Added font-variant-numeric: tabular-nums to diff stats
- Set details row gap to 4px (matching original)
- Adjusted separator margin since gap handles spacing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix icon size: match original 16px height, remove explicit width

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix spacing: match original layout exactly

- Replaced gap:8px with padding-left:6px on main column (matching original)
- Icon column uses flex-start + line-height:17px (matching original)
- Codicon inside icon gets font-size:12px, height:16px (matching original)
- Icon state classes (active/pulse) on container, not codicon span

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix hover margins, grouping, and icon size

- Added padding: 0 6px to scrollable element for horizontal margins
- Fixed grouping: use getRepositoryName() from agentSessionsViewer for
  proper repository name extraction from metadata (checks owner/name,
  repositoryNwo, repository, repositoryUrl, repositoryPath, etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Replicate old agent sessions viewer CSS into new sessions list control

Align the sessions list styling with the old agentsessionsviewer.css:
- Section header: label left-aligned, count right-aligned with margin-left auto
- Section header padding: 0 6px (aligned with session item text)
- Session item: padding 8px 6px, no border-radius on item (on list-row instead)
- List row: border-radius 6px on .monaco-list-row
- Icon: font-size 12px, height 16px, flex-centered
- Title row: line-height 17px, padding-bottom 4px
- Details row: gap 4px, font-size 12px, line-height 15px, max-height 15px
- Diff stats: tabular-nums, chat-specific green/red colors
- Selection/focus colors on section header labels
- Unset colors on selected items for proper theme contrast
- Needs-input pulse animation with 0.4 opacity at 50%
- Reduced motion support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix import paths for agent host file system and URI schemes

* Fix repository metadata extraction to match sessionsManagementService

Align _buildWorkspace/_extractRepositoryFromMetadata in
CopilotChatSessionsProvider with the authoritative
getRepositoryFromMetadata logic:

- Cloud sessions: construct GitHub URI from owner/name/branch metadata
  fields instead of reading a pre-built 'repository' string
- CLI sessions: check workingDirectoryPath first, then fall back to
  repositoryPath + worktreePath (was using 'folder' + 'worktree')
- Use URI.file() for local paths instead of URI.parse()
- Add URI.isUri() validation on constructed URIs
- Fix unicode characters in section comments for hygiene

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate aiCustomizationWorkspaceService from activeSession to activeSessionData

Replace all IActiveSessionItem usage with ISessionData:
- activeSession.read(reader) → activeSessionData.read(reader)
- getActiveSession() → activeSessionData.get()
- session.worktree/repository → workspace.repositories[0].workingDirectory/uri

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate chat.contribution.ts from activeSession to activeSessionData

Replace IActiveSessionItem usage with ISessionData in OpenInVSCode action:
- activeSession.get() → activeSessionData.get()
- providerType → sessionType
- worktree/repository → workspace.repositories[0].workingDirectory/uri

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate workspaceFolderManagement from activeSession to activeSessionData

Replace all IActiveSessionItem usage with ISessionData:
- activeSession.read(reader) → activeSessionData.read(reader)
- session.worktree → workspace.repositories[0].workingDirectory
- session.repository → workspace.repositories[0].uri
- session.worktreeBranchName → workspace.repositories[0].detail
- session.providerType → session.sessionType

Also fix pre-existing hygiene issues in sessionsListControl.ts:
- Merge duplicate tree.js import
- Use targetWindow.setInterval/clearInterval for multi-window support
- Replace unicode box-drawing characters with ASCII

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate changesViewActions + fixCIChecksAction from activeSession to activeSessionData

- changesViewActions: use activeSessionData.read(reader) instead of
  activeSession.read(reader) + getActiveSession()
- fixCIChecksAction: use activeSessionData in both derived observable
  and run() method

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate runScriptAction + sessionsConfigurationService from activeSession to activeSessionData

Replace all IActiveSessionItem usage with ISessionData across:
- runScriptAction.ts: IRunScriptActionContext, all method signatures,
  field accesses (worktree/repository/isUntitled → workspace/status)
- sessionsConfigurationService.ts: all interface methods, internal
  helpers (_getTasksJsonUri, _commitTasksFile, _handleActiveSessionChange)
- sessionsManagementService.ts: commitWorktreeFiles, getGitHubContext,
  getGitHubContextForSession, _parsePRNumberFromSession signatures
- sessionsConfigurationService.test.ts: makeSession() creates ISessionData
  with observables instead of IActiveSessionItem

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate changesView from activeSession to activeSessionData

Replace all deprecated activeSession/getActiveSession usage:
- activeSessionResourceObs: use activeSessionData.read(reader)
- activeSessionRepositoryPromiseObs: read workspace.repositories[0].workingDirectory
- agentSessionType context key: use sessionType instead of providerType
- isMergeBaseBranchProtected: read from workspace.repositories[0].baseBranchProtected
- CI status widget: use activeSessionData for derived observables

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add method to get workspace badge label for GitHub remote sessions

* Migrate remaining consumers from activeSession to activeSessionData

Migrate all remaining files that used the deprecated activeSession/
getActiveSession API:
- changesViewController.ts
- github.contribution.ts
- agentFeedback.contribution.ts + agentFeedbackEditorActions.ts
- fileTreeView.ts (resolveTreeRoot uses workspace.repositories[0])
- applyChangesToParentRepo.ts
- sessionsTerminalContribution.ts (getSessionCwd uses workspace)
- codeReviewService.ts + codeReview.contributions.ts
- sessionsViewPane.ts (both old and new views)
- remoteAgentHost.contribution.ts
- workbench.ts (IMinimalSessionsManagementService)
- Fix unicode box-drawing characters in sessionsListControl and sessionsViewPane

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refactor collapse state handling in SessionsListControl

* Remove deprecated IActiveSessionItem, activeSession, and getActiveSession

Remove the deprecated active session API from ISessionsManagementService:
- Remove IActiveSessionItem interface
- Remove activeSession observable and getActiveSession() method
- Remove _activeSession field, doSetActiveSession, equalsSessionItem
- Simplify setActiveSession to set context keys and activeSessionData directly
- Fix customizationsToolbar.contribution.ts missed reference
- Update all test files to use ISessionData instead of IActiveSessionItem
- Fix unicode box-drawing characters

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add pin and unpin session actions to Sessions View Pane

* Rename activeSessionData back to activeSession

Now that IActiveSessionItem is removed, rename activeSessionData to
activeSession across all 36 files for cleaner naming.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add event for session type changes in SessionsManagementService

* Enhance session management by adding session type tracking and updating logic

* Use ISessionData.changes instead of falling back to agent session model

Replace patterns that read activeSession.resource then look up
agentSessionsService.getSession() just to access .changes:

- changesViewActions.ts: use activeSession.changes.read(reader) directly
  instead of agentSession lookup + hasValidDiff
- changesViewController.ts: use activeSession.changes.read(reader) for
  activeSessionHasChangesObs, remove unused sessionsChangedSignal
- codeReview.contributions.ts: use ISessionData.changes in both
  RunSessionCodeReviewAction and CodeReviewToolbarContribution,
  remove IAgentSessionsService dependency from both

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate codeReviewService from IAgentSessionsService to ISessionsManagementService

Replace all agent session service usage with sessions management service:
- Constructor: use onDidChangeSessions for PR review init + dispose
  (replaces model.onDidChangeSessions + onDidChangeSessionArchivedState)
- _registerSessionListeners: use onDidChangeSessions for cleanup of
  removed sessions and stale review versions; use getSessions() +
  ISessionData.changes instead of agentSessionsService.getSession()
- Remove IAgentSessionsService dependency entirely

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add archived and read status to ISessionData interface

* Add archived field to ISessionsChangeEvent

Add 'archived' to the session change event so consumers can
distinguish between removed and archived sessions:
- ISessionsChangeEvent: add archived: readonly ISessionData[]
- CopilotChatSessionsProvider: listen for onDidChangeSessionArchivedState
  and fire archived events; include archived: [] in refresh events
- SessionsManagementService: handle archived in onDidChangeSessions
  to clear active session (replaces direct agentSessionsService listener)
- CodeReviewService: clean up reviews for archived sessions
- Add isArchived/isRead to test helpers and remote provider

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add lastTurnEnd to ISessionData and use in changesViewController

Add lastTurnEnd observable to ISessionData so consumers can detect
turn completion without reaching into the agent session model:
- ISessionData: add lastTurnEnd: IObservable<Date | undefined>
- AgentSessionAdapter: track timing.lastRequestEnded reactively
- CopilotCLISession, RemoteNewSession: initialize as undefined
- RemoteAgentHostSessionsProvider: initialize as undefined
- changesViewController: use activeSession.lastTurnEnd.read(reader)
  instead of agentSessionsService.getSession().timing; remove
  IAgentSessionsService dependency entirely
- Update test helpers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enhance session item rendering with session type and update status icon logic

* Migrate .changes access from agent session model to ISessionData

Replace agentSessionsService.getSession().changes with
ISessionData.changes across multiple consumers:

- changesView.ts: activeSessionChangesObs reads from
  activeSession.changes.read(reader); code review toolbar uses
  activeSession.changes.read(reader)
- agentFeedbackService.ts: iterate sessionsManagementService.getSessions()
  instead of agentSessionsService.model.sessions; use ISessionData.changes
  for revealSessionComment; remove IAgentSessionsService dependency
- agentFeedbackEditorUtils.ts: getSessionForResource and
  getSessionChangeForResource prefer ISessionsManagementService
- agentFeedbackEditorWidgetContribution.ts: prefer ISessionData.changes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refactor session status handling to include NeedsInput state and remove unused CSS for read indicator

* Migrate sessionsTitleBarWidget to use sessions management service

- Use activeSessionService.onDidChangeSessions instead of
  agentSessionsService.model.onDidChangeSessions for re-rendering
- Rewrite _countUnreadSessions to use ISessionData observables
  (isArchived, status, isRead) instead of countUnreadSessions()
- Context menu still uses agentSessionsService for IMarshalledAgentSessionContext

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* implement approval row

* fix handling sessions change event

* context menu events

* support description

* fix compilation

* fix compilation

* fixes

* more fixes

* add repository option handling in RemoteNewSession

* fix cloud session

* delete empty files

* clean up

* fix compilation

* fix grouping by time

* Add sessions provider architecture documentation to README.md

Add comprehensive architecture section with:
- Overview diagram showing UI → ManagementService → ProvidersService → Providers
- Core concepts: ISessionType, ISessionsProvider, ISessionData
- Example providers: CopilotChatSessionsProvider, RemoteAgentHostSessionsProvider
- Data flow diagrams: creating a new session, session change events
- Key files reference table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enhance architecture diagram with ISessionData and ISessionWorkspace

Show ISessionData observable properties and ISessionWorkspace
structure inline in the main diagram, plus note that UI components
read these observables for reactive updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move workspace remembering from provider to picker

Remove getWorkspaces() from ISessionsProvider — the picker now owns
all recent workspace storage:

- SessionWorkspacePicker: add recent workspace storage with per-provider
  key. Workspaces remembered on selection (list or browse).
- CopilotChatSessionsProvider: remove workspace storage, IStorageService,
  IUriIdentityService dependencies.
- ISessionsProvider: remove getWorkspaces() from interface.
- Fix copyright headers on files missing them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make workspace picker multi-provider aware

Show browse actions and recent workspaces from all registered providers,
not just the active one:
- _getAllBrowseActions: collect from all providers
- _buildItems: show recent workspaces from all providers, grouped by
  provider when multiple exist
- Restore still prefers the active provider's last selected workspace

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove sessions provider picker from titlebar widget

The provider picker is no longer needed since the workspace picker
is now multi-provider aware and shows browse actions from all providers:
- Remove SessionsProviderPicker instantiation and import
- Remove provider label/icon rendering for untitled sessions
- Always show sessions picker on click (no conditional provider picker)
- Remove _isUntitledSession helper (was only used for provider display)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Persist workspace icon in recent workspaces storage

Store the workspace icon ID alongside the URI so the picker shows
the correct icon (e.g., remote icon for agent host workspaces, repo
icon for GitHub repositories) instead of always falling back to the
URI-scheme-based default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Resolve workspace via provider instead of storing icon

Add resolveWorkspace(repositoryUri) to ISessionsProvider so the picker
delegates label/icon resolution to the provider that owns the workspace:

- ISessionsProvider: add resolveWorkspace(URI) → ISessionWorkspace
- ISessionsProvidersService: add resolveWorkspace(providerId, URI)
- CopilotChatSessionsProvider: implements using _labelFromUri/_iconFromUri
- RemoteAgentHostSessionsProvider: implements with remote icon + host label
- WorkspacePicker: _getRecentWorkspaces uses resolveWorkspace instead of
  local _labelFromUri/_iconFromUri; storage only has uri + providerId
- Remove _labelFromUri, _iconFromUri, iconId from picker

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add provider separators for browse actions in workspace picker

Group browse actions by provider with labeled separators showing
the provider name, so users can distinguish between e.g. Copilot's
Browse Folders/Repositories and an Agent Host's Browse Remote Folders.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix test

* add pull request data to the session

* more changes

* more view parity

* more parity

* Remove provider separators from browse actions in workspace picker

Show all browse actions in a flat list with a single separator from
the recent workspaces, without per-provider labels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate legacy recent workspaces from old storage format

Old CopilotChatSessionsProvider stored recent workspaces as
{ uri }[] without providerId. The picker now handles entries
missing providerId by defaulting to COPILOT_PROVIDER_ID, ensuring
existing recent workspaces are preserved after the migration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix workspace picker sorting: local folders first, then repos

Sort recent workspaces with local folders (file:// scheme) before
remote repositories, alphabetical within each group. Matches the
old CopilotChatSessionsProvider.getWorkspaces() sorting behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix recent workspaces migration from old storage format

Re-add migration logic that was lost: entries without providerId
in the storage are assigned COPILOT_PROVIDER_ID so old recent
workspaces are properly resolved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* remove

* more clean up

* Refactor workspace selection and migration logic for improved storage handling

* fix e2e

* disable e2e (temp)

* remove unused file

* fix cyclic deps

* fix tests

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: BeniBenj <besimmonds@microsoft.com>
2026-03-25 20:20:31 +01:00
Lee Murray
ce19b8e0e9 Refactor theme and layout for sidebar, panel, and auxiliary components (#304447)
* refactor: update theme colors for sidebar, panel, and auxiliary bar components

Co-authored-by: Copilot <copilot@github.com>

* refactor: update sidebar and panel styles to remove right borders and adjust colors

* refactor: adjust margin values for chatbar, auxiliary bar, and panel components

Co-authored-by: Copilot <copilot@github.com>

* refactor: adjust layout margins for chatbar, panel, and sidebar components

Co-authored-by: Copilot <copilot@github.com>

* refactor: update padding for account widget and agent sessions viewer components

Co-authored-by: Copilot <copilot@github.com>

* refactor: adjust footer margins and add bottom margin for sessions view pane

Co-authored-by: Copilot <copilot@github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: remove unused imports in sidebarPart.ts

Co-authored-by: Copilot <copilot@github.com>

* refactor: update theme colors for sessions components and adjust background properties

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-24 17:10:18 +00:00
João Moreno
fc6b2053dd fix: trigger stable build instead of insider build on release branches (#304406)
Co-authored-by: Copilot <copilot@github.com>
2026-03-24 09:37:56 +00:00
Benjamin Christopher Simmonds
bb77888173 Fix Windows agent harness links in postinstall (#304392)
* Fix Windows agent harness links in postinstall

* Update build/npm/postinstall.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-24 09:57:28 +01:00
Tyler James Leonhardt
8978366531 Move .claude creation for testing agent harness to postinstall (#304283)
* Move .claude creation for testing agent harness to postinstall

title says it all

* rest
2026-03-23 23:22:35 +01:00
Rob Lourens
6c52b71c9a Bump copilot-sdk (#304267)
Co-authored-by: Copilot <copilot@github.com>
2026-03-23 21:58:56 +00:00
Dmitriy Vasyura
551308fdbc Remove automated trigger for sanity tests pipeline (#304168) 2026-03-23 17:32:38 +00:00
Tyler James Leonhardt
56498ab932 fix: correct file extension check in update-localization-extension script (#303930)
this should fix loc process now.
2026-03-23 00:47:07 +00:00
Alexandru Dima
be95b65d71 Fix terminal output capture: strip command echo/prompt, fix premature idle detection, improve sandbox failure detection, force bash over sh (#303754)
* fix: strip command echo and prompt from terminal output (#303531)

Prevent sandbox-wrapped command lines from leaking as output when

commands produce no actual output. Adds stripCommandEchoAndPrompt()

to isolate real output from marker-based terminal buffer captures.

Also adds configurable idle poll interval and shell integration

timeout=0 support for faster test execution.

* Fix compilation errors

* fix: tighten trailing prompt stripping to avoid dropping legitimate output

Anchor prompt-detection regexes to specific prompt shapes instead of
broadly matching any line ending with $, #, %, or >. This prevents
stripping real command output like "100%", "<div>", or "item #".

* Review feedback

* fix: skip stale prompt fragments before command echo in stripping

In CI, ^C cancellations leave stale prompt fragments before the actual
command echo line. The leading-strip loop now continues scanning past
unmatched lines until it finds the command echo, instead of breaking
on the first non-matching line.

* fix: handle macOS CI prompt format and add stripping to rich strategy

- Add trailing prompt patterns for hostname:path user$ (no @ sign)
- Handle wrapped prompt fragments like "er$" at line boundaries
- Add stripCommandEchoAndPrompt to RichExecuteStrategy marker fallback
- Context-aware wrapped prompt continuation detection

* fix: Linux CI sandbox prereqs, platform-aware tests, broader prompt stripping

- Add bubblewrap and socat to Linux CI apt-get install
- Make sandbox test assertions platform-aware (macFileSystem vs linuxFileSystem)
- Make /etc/shells test accept both macOS and Linux first-line format
- Broaden wrapped prompt fragment regex to handle path chars (ts/testWorkspace$)
- Fix continuation pattern to match user@host:path wrapped lines
- Apply stripCommandEchoAndPrompt to getOutput() in BasicExecuteStrategy
  (basic shell integration lacks reliable 133;C markers so getOutput()
  can include command echo)
- Keep RichExecuteStrategy getOutput() unstripped (rich integration
  has reliable markers)

* fix: detect sandbox failures heuristically when exit code is unavailable

* Relax some tests when shell integration is off

* refactor: extract findCommandEcho and use prompt evidence to narrow trailing prompt regex matching

* Cover case where the command is duplicated in `stripCommandEchoAndPrompt`

* Fix sandbox tests for Linux: handle different shell path and error message

- Handle /usr/bin/bash (Linux) vs /bin/bash (macOS) in /tmp write test
- Handle 'Read-only file system' (Linux) vs 'Operation not permitted' (macOS)
- Add 'Read-only file system' to outputLooksSandboxBlocked heuristic
- Replace newlines with spaces (not empty) to handle terminal wrapping
- Extract outputLooksSandboxBlocked as exported function with unit tests

* Fix slash history test

* Fix sandbox execPath resolution for remote environments

Add execPath to IRemoteAgentEnvironment so the server sends its actual
process.execPath to the client. The sandbox service now uses this instead
of hardcoding appRoot + '/node', which only works in production builds.

* Fix terminal output capture: prevent premature idle detection and handle partial command echoes

- setupRecreatingStartMarker returns IDisposable to stop marker recreation
  before sending commands (prevents marker jumping on PSReadLine re-renders)
- noneExecuteStrategy waits for cursor to move past start line after sendText
  before starting idle detection (prevents end marker at same line as start)
- findCommandEcho supports suffix matching for partial command echoes from
  wrapped getOutput() results (shell integration ON with long commands)
- Suffix matching requires mid-word split to avoid false positives on output
  that happens to be a suffix of the command (e.g. echo output)
- Integration tests: use ; separator on Windows, add && conversion test,
  handle Windows exit code quirks with cmd /c

* Fix mock in unit test

* Address PR feedback: logging, performance, timeout, and docs

- Strip sensitive data from debug logs (log metadata only)
- Use array join instead of O(n^2) string concat in stripNewLinesAndBuildMapping
- Add 5s timeout to cursor-move wait to prevent indefinite hangs
- Align shellIntegrationTimeout descriptions (0 = skip the wait)

* Install bubblewrap and socat in Linux CI pipelines

These are required for terminal sandbox integration tests.

* Force /bin/bash over /bin/sh for copilot terminal profile

Shell integration cannot be injected into /bin/sh, causing loss of
exit code detection. This matches the existing cmd.exe -> powershell
override pattern.

* Fix bracketed prompt without @ and cap trailing prompt stripping at 2 lines

- Extend bracketed prompt patterns from isUnixAt to isUnix so prompts
  like [W007DV9PF9-1:~/path] are recognized (CI macOS prompt format)
- Cap trailing prompt stripping at 2 non-empty lines to prevent
  over-stripping legitimate output
- Add unit tests for bracketed prompt without @ format

* Distinguish complete vs fragment prompts to prevent false stripping

Split trailing prompt patterns into two categories:
- Complete prompts (user@host:~ $, PS C:\>, etc.) stop stripping
  immediately — anything above is command output, not a wrapped prompt
- Fragment patterns (er$, ] $, [host:~/path...) allow continued
  stripping to reassemble wrapped prompts

This prevents falsely stripping output lines that happen to end with
$ or # when a real complete prompt sits below them. Added adversarial
tests verifying correct behavior for output containing prompt-like
characters.

* Attempt to cover up the `run_in_terminal` tool not being registered quickly
2026-03-22 11:37:34 +01:00
Robo
30c0bd03a4 chore: bump electron@39.8.3 (#303738)
* chore: bump electron@39.8.3

* chore: update build

* chore: bump distro
2026-03-22 07:20:14 +01:00
Alex Dima
f0a7531832 Install bubblewrap and socat in Linux CI pipelines
These are required for terminal sandbox integration tests.
2026-03-22 01:49:00 +01:00
Rob Lourens
a7fffd156c Enable starting sessions on remote agent hosts in sessions app (#303631)
* Enable starting sessions on remote agent hosts in sessions app

Co-authored-by: Copilot <copilot@github.com>

* Fix

Co-authored-by: Copilot <copilot@github.com>

* fix

Co-authored-by: Copilot <copilot@github.com>

* fix

Co-authored-by: Copilot <copilot@github.com>

* fix test

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-03-20 17:16:33 -07:00
Raymond Zhao
a4b2a1610d chore: bump flatted (#303340) 2026-03-20 14:04:42 -07:00
Henning Dieterichs
c9335c2873 node_modules is stale -> ignore node-version changes 2026-03-20 22:04:20 +01:00
Connor Peet
b7462b4a00 Merge pull request #303597 from microsoft/connor4312/agent-host-server-fixups
agentHost: fixup build for server
2026-03-20 13:54:33 -07:00
dependabot[bot]
702949b935 Bump fast-xml-parser from 5.5.6 to 5.5.7 in /build (#303324)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.5.6 to 5.5.7.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.5.6...v5.5.7)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.5.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-20 07:54:37 -07:00
Robo
31ed44d62d fix: support protocol handling for sessions app on windows (#303398)
* fix: support protocol handling for sessions app on windows

* chore: always use HKCU for protocol registration
2026-03-20 08:33:22 +00:00
Robo
4315cca958 Revert "chore: bump electron@39.8.3" (#303369)
* Revert "chore: bump electron@39.8.3 (#302875)"

This reverts commit d4f7ac5014.

* chore: bump distro
2026-03-20 02:21:37 +00:00
Sandeep Somavarapu
5c9a7c6e04 Adding chat debug view in Sessions window (#303172)
show chat debug view in sessions app
2026-03-19 12:23:18 +00:00
Raymond Zhao
1bd8567766 chore: run npm audit fix (#302988) 2026-03-18 22:10:27 +00:00
Robo
d4f7ac5014 chore: bump electron@39.8.3 (#302875)
* chore: bump electron@39.8.3

* chore: bump distro
2026-03-18 20:26:19 +00:00
Rob Lourens
5b771fc25e Also handle copilot native deps in remote server build (#302603)
* Remote server copilot build fixes

* Don't strip copilot from stable builds

* Handle all platforms for copilot
2026-03-18 12:10:30 -07:00
Dmitriy Vasyura
9de7db1a5c Sanity tests improvements (#302917) 2026-03-18 18:42:27 +00:00
dependabot[bot]
a727b5577c build(deps-dev): bump fast-xml-parser from 5.4.1 to 5.5.6 in /build (#302610)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.4.1 to 5.5.6.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.4.1...v5.5.6)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.5.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-18 08:18:34 -07:00
Rob Lourens
77c1d46b28 Merge remote-tracking branch 'origin/main' into connor4312/agent-host-server 2026-03-17 15:07:52 -07:00
Robo
8f136419bb chore: disallow node version untested for development (#302550)
* chore: disallow node version untested for development

* chore: wording feedback

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 21:00:39 +00:00
Rob Lourens
1c035e8297 Merge branch 'main' into connor4312/agent-host-server 2026-03-17 13:56:32 -07:00
João Moreno
c58fd111b2 fix: rename pipeline (#302543) 2026-03-17 20:37:18 +00:00
Rob Lourens
6076e772e8 Clean up dead code 2026-03-17 11:47:04 -07:00
Connor Peet
927a0932fc fix 2026-03-17 11:36:56 -07:00
Rob Lourens
2944e51725 Copilot using vscode's ripgrep (#302323) 2026-03-17 17:57:16 +00:00
João Moreno
19daf4d536 feat: rename pipeline and fix esm script (#302466)
Co-authored-by: Copilot <copilot@github.com>
2026-03-17 16:06:38 +00:00
João Moreno
e3b4bdb925 allow terrapin checks to by manually triggered and report results back to GitHub (#302451)
* initial terrapin check poc

* bump terrapin timeout, remove trigger

* allow terrapin checks to by manually triggered and report results back to GitHub

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-03-17 14:34:34 +00:00
João Moreno
817d225857 Change Terrapin checks to be manual dispatches, increase timeouts (#302398)
* initial terrapin check poc

* bump terrapin timeout, remove trigger
2026-03-17 14:12:56 +00:00
Robo
f8fd37feb6 chore: bump electron@39.8.2 (#302204) 2026-03-17 07:54:12 +00:00
Robo
555f6469c6 ci: fix universal build for fs-copyfile usage in git extension (#302332) 2026-03-17 07:45:44 +01:00
Josh Spicer
2a5a1757fd build(next): include sessions built-in skills in desktop resources (#302297)
Enhance AI Customization: Add support for plugin skills in data source
2026-03-16 19:06:19 -07:00
Rob Lourens
3da382383e Merge remote-tracking branch 'origin/main' into connor4312/agent-host-server 2026-03-16 16:25:07 -07:00
Rob Lourens
98f15b55ea Implement agentHost process (#296627)
* agent host init

* Agent host: Copilot SDK integration with chat UI

* Agent host: direct MessagePort, logging, SDK wrapper, env fix

* Refactoring and cleanup

* Copilot-authored message: Agent-host tool rendering, protocol, and session fixes

Tool invocation rendering:
- Emit tool_start/tool_complete as ChatToolInvocation (not progressMessage)
- Shell tools (bash/powershell) render as terminal command blocks with
  IChatTerminalToolInvocationData, output, and exit codes
- Non-shell tools render via invocationMessage/pastTenseMessage (markdown)
- Filter out report_intent (hidden internal tool)

Agent-agnostic protocol:
- IPC events carry display-ready fields (displayName, invocationMessage,
  pastTenseMessage, toolInput, toolOutput, toolKind, language)
- All Copilot CLI-specific logic in copilotToolDisplay.ts with typed
  interfaces for known tools (CopilotToolName enum, parameter types)
- Renderer never references specific SDK tool names

Session fixes:
- Resumed sessions show tool invocations in history (getSessionMessages
  now returns tool events alongside messages)
- Fixed 'already has a pending request' on resumed sessions by
  conditionally providing interruptActiveResponseCallback
- Fixed event filtering for resumed sessions (sessionId override in
  _trackSession)

Documentation:
- Split parity.md into design.md (decisions) and backlog.md (tasks)
- Updated architecture.md, sessions.md with cross-references
- Added maintenance notes to all docs

* Copilot-authored message: Model picker, session class, DI and test cleanup

* Cleanups

* stuff

* add diagram

* Add claude agent

* Clean up

* Copy some build script changes from #295817

* Simplify

* Update docs

* Register agent-host via chatSessions contribution API, reduce peripheral diff

* Cleanup

* Don't ship stuff in stable

* Dynamic agent discovery via listAgents() IPC

Replace hardcoded per-provider contributions with a single
AgentHostContribution that discovers available agents from the
agent host process at startup. Each IAgent backend now exposes
an IAgentDescriptor with display metadata and auth requirements.

- Add IAgentDescriptor interface and listAgents() to IPC contract
- CopilotAgent/ClaudeAgent return descriptors via getDescriptor()
- Single AgentHostContribution discovers + registers dynamically
- Remove agentHostConstants.ts (no more hardcoded session types)
- AgentHostSessionListController/LMProvider take params instead
- Rename AgentSessionProviders.AgentHost -> AgentHostCopilot
- Update architecture.md, sessions.md, backlog.md

(Written by Copilot)

* Fix review findings: proxy, disposal, filtering, tests

- Add listAgents() forwarding to AgentHostServiceClient
- Guard async discovery against disposal race
- Add provider field to IAgentModelInfo for per-provider filtering
- Filter models and sessions by provider in LM provider and list
  controller
- Update tests for new dynamic API and agent-host-copilot scheme

(Written by Copilot)

* Use DI for AgentHostLanguageModelProvider

(Written by Copilot)

* Strip @img/sharp native binaries from builds

sharp is a transitive dependency of the Claude Agent SDK used for
image processing. Its native .node binaries cause dpkg-shlibdeps
errors during Debian packaging due to $ORIGIN RPATH references.
Strip all @img/sharp-* platform packages since the agent host
doesn't need image processing at runtime.

(Written by Copilot)

* Strip Claude SDK vendored ripgrep binaries

The Claude Agent SDK bundles ripgrep binaries for all platforms
under vendor/ripgrep/. Wrong-architecture binaries cause macOS
Mach-O verification to fail. Strip them entirely via .moduleignore
(VS Code has its own ripgrep) and add to verify-macho skip list.

(Written by Copilot)

* Add tests for AgentSession, AgentService dispatcher, and workbench agent host components

(Written by Copilot)

* Add trace logging, IPC output channel, tool permissions, and attachment context

- Add Agent Host IPC output channel (only registered at trace log level) that
  logs all IPC method calls, results, and progress events with full JSON payloads
- Add trace-level logging in AgentService dispatcher for all method calls
- Add trace-level logging in session handler for all progress events and session
  resolution
- Wire up onPermissionRequest handler on CopilotClient.createSession and
  resumeSession to auto-approve tool permission requests
- Add IAgentAttachment type to IPC contract and thread attachments from chat
  variables (file, directory, selection) through sendMessage to the Copilot SDK

(Written by Copilot)

* Add tests for attachment context conversion and threading

(Written by Copilot)

* Add gap analysis docs for Copilot and Claude SDK implementations

(Written by Copilot)

* Sanitize env vars for Copilot CLI subprocess

Strip VSCODE_*, ELECTRON_* (except ELECTRON_RUN_AS_NODE), NODE_OPTIONS, and
other debug-related env vars that can interfere with the Node.js process the
SDK spawns. Matches the env sanitization from the extension implementation.
Also set useStdio and autoStart for proper CLI communication.

(Written by Copilot)

* Add error, usage, and title_changed event types to IPC contract

Add IAgentErrorEvent, IAgentUsageEvent, and IAgentTitleChangedEvent to the
progress event union. Wire up session.error and assistant.usage events from
the Copilot SDK to fire as IPC events instead of only logging. Handle error
events in the renderer session handler by rendering the error message. Usage
and title_changed events are logged at trace level.

(Written by Copilot)

* Add abortSession IPC method for proper cancellation

Add abortSession(session) to the IPC contract, implemented across AgentService,
CopilotAgent (calls session.abort()), ClaudeAgent (no-op, uses AbortController),
and the renderer proxy. Wire up cancellation in the session handler to call
abortSession before finishing, so the SDK actually stops processing.

(Written by Copilot)

* Address reviewer feedback: error finishes request, Claude abort, tests

- Error events now call finish() so the request doesn't hang if the SDK
  doesn't send idle after an error
- ClaudeAgent.abortSession calls ClaudeSession.abort() which signals the
  AbortController and creates a new one for future turns
- Add test: cancellation calls abortSession on the agent host service
- Add test: error event renders message and finishes the request
- Remove stale TODO in interruptActiveResponseCallback
- Use timeout() helper instead of raw setTimeout in test
- Update gap docs to reflect completed work

(Written by Copilot)

* Add permission request IPC round-trip (Written by Copilot)

* Remove Claude agent from agent-host process

Strip the Claude Agent SDK integration from the agent-host utility process
to focus on the Copilot SDK path.

- Delete src/vs/platform/agent/node/claude/ (claudeAgent, claudeSession, claudeToolDisplay)
- Remove @anthropic-ai/claude-agent-sdk from package.json
- Remove AgentHostClaude enum member and all switch cases
- Remove Claude command registration in electron-browser chat.contribution
- Clean up build scripts (.moduleignore, verify-macho, gulpfile.vscode)
- Narrow AgentProvider type to just 'copilot'
- Update tests and documentation

(Written by Copilot)

* Wire up permission confirmation UI with ChatToolInvocation (Written by Copilot)

* Fix reviewer feedback: safe permission serialization, deny on abort/dispose (Written by Copilot)

* Forward reasoning events as thinking blocks (Written by Copilot)

* Pass workspace folder as workingDirectory to Copilot SDK (Written by Copilot)

* Store and pass workingDirectory on session resume, update gap docs (Written by Copilot)

* Fix permission rendering, session-scoped permissions, and test gaps (Written by Copilot)

* Auto-approve read permissions inside workspace folder (Written by Copilot)

* Move read auto-approve into CopilotAgent where permission policy belongs (Written by Copilot)

* Update gap docs (Written by Copilot)

* Use log language for IPC output channel, add trace prefix (Written by Copilot)

* Add tool rendering gaps to docs (Written by Copilot)

* Stringify URIs in IPC output channel for readability (Written by Copilot)

* Fix IPC output channel: use log languageId with non-log channel for proper append + syntax highlighting (Written by Copilot)

* Fix build errors: add URI import, fix test mock types (Written by Copilot)

* Don't localize agent host provider strings (Written by Copilot)

* Remove claude-agent-sdk from eslint allowed imports (Written by Copilot)

* fix test

* initial thoughts

* Rename folder to agentHost

* Fix paths

* Fixes

* Fixes for copilot

* Fix moduleignore

* first working protocol version

align more closely with protocol

json rpc and some gaps

* cleanup

* Fix copilot pty.node packaging

* Fix test

* prebuild packaging

* Agenthost server fixes

* Update monaco.d.ts

* Update docs

* Fixes

* Build fix

* Fix build issues

* reduce duplication in side effecting code

* fix model switching not working

* reduce mock duplication

* Build fixes

* Copy vscode's node.pty

* And ripgrep

* And thsi

* Ripgrep goes to non-SDK

* Skip copy for stable build

* Remove outdated script

* Build fixes for asar

* fix

* Add some logging

* Fix for windows

* Fix

* Logs

* build: add glob diagnostic for copyCopilotNativeDeps

* build: check both node_modules/ and .asar.unpacked/ for source binaries

* Fix

* Remove excalidraw

---------

Co-authored-by: Connor Peet <connor@peet.io>
Co-authored-by: Connor Peet <copeet@microsoft.com>
2026-03-16 15:33:31 -07:00