The fixReferences function in jsonSchema_v2.ts would crash with
"Cannot read properties of null (reading '$ref')" when a task
definition from an extension contained null property values.
typeof null === 'object' in JavaScript, so the guard on line 31
would pass for null values, causing a recursive call into null.
The array element path (line 21) already had a null check but
the object property path was missing it.
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/97290369-e210-4404-b2b7-7c8ca4a2f84b
Co-authored-by: bryanchen-d <41454397+bryanchen-d@users.noreply.github.com>
* Revert bad merge from #306130
Co-authored-by: Copilot <copilot@github.com>
* Always resolve language models on provider registration
Previously, registerLanguageModelProvider only eagerly resolved models
when _hasStoredModelForVendor returned true. Otherwise it waited for
onDidChange. This created a hidden temporal coupling: if a provider
populated models before registration (like AgentHostLanguageModelProvider),
the onDidChange event fired with no listener attached, and the models
never appeared.
Fix: always call _resolveAllLanguageModels on registration. This is safe
(the provider guard handles unregistration races, and the per-vendor
sequencer prevents duplicate work).
Also use ActiveSessionProviderIdContext.key instead of a hardcoded string
in the remote agent host context key expression.
(Written by Copilot)
* fix
Co-authored-by: Copilot <copilot@github.com>
* fix
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
- Handle message events in AgentEventMapper to emit markdown response
parts for text that arrives without preceding delta events (e.g. after
tool calls complete)
- Fix tool call confirmation flickering by guarding PendingConfirmation
re-entry when the invocation is already waiting for confirmation
- Fix tool call duplication in server-initiated turns and reconnection
by not removing finalized tool calls from the tracking map
- Add isComplete guard in finish() to avoid overwriting finalized tool
call state
- Extract processState in _trackServerTurnProgress for immediate state
reconciliation closing gaps between turn detection and listener
registration
- Fix session disappearing from list after first message by adding
pending session tracking and onDidReplaceSession in the remote
sessions provider
- Wrap all tests using timeouts with runWithFakedTimers
* sessions: show status of remote connections, reconnect AH connects
- Add automatic reconnect with exponential backoff (1s-30s) when a
remote agent host WebSocket connection drops, preserving the session
cache during reconnect attempts
- Add RemoteAgentHostConnectionStatus enum (Connected/Connecting/
Disconnected) to IRemoteAgentHostConnectionInfo and expose it on
ISessionsProvider via an observable
- Add reconnect(address) method to IRemoteAgentHostService for
explicit reconnect with reset backoff
- Always show configured remote hosts in the workspace picker with
connection status indicators and a gear button for management
- Gear menu offers Reconnect, Remove Remote, Copy Address, Open
Settings, and Show Output actions via quickpick
- Remote host browse actions are grouped into the "Select..." submenu
alongside other providers when multiple providers exist

* address PR review comments
- Fix outputChannelId mutability: use getter + setOutputChannelId()
- Fix disposable leak on reconnect: dispose old entry in _connectTo()
- Remove duplicate AGENT_HOST_LABEL_FORMATTER registrations from
contribution files; centralize in AgentHostFileSystemService
- Fix duplicate IRemoteFilesystemConnection: re-export from provider
- Localize all user-facing status/hover/quickpick strings properly
- Fix setTimeout leak: track timer in _renderDisposables
- Register authority disposal in agentHostChatContribution
- Re-setup ConnectionState when clientId changes on reconnect
* fix tests for new connection status behavior
- Update remoteAgentHostService tests: connections now include
Connecting/Disconnected entries, use waitForConnected() helper,
add status field to deepStrictEqual assertions
- Add IAgentHostFileSystemService stub to agentHostChatContribution
test setup
* Enhance quick input modal styling and functionality; add close button and improve padding
* Refactor quick input and run script action styles; adjust padding, height, and add new button styles
* Update quick input and run script action styles; adjust border radius, padding, and gap for improved UI consistency
* Refactor task action labels; remove ellipses for improved clarity
* Refactor quick input and run script action styles; adjust padding and add new titlebar styles for improved UI consistency
* Remove background color styles for quick input widget in run script action for improved UI consistency
* Refactor quick input header and run script action padding for improved layout consistency
* Add background color to quick input header and run script action widget for improved UI consistency
* Refactor run script action styles; adjust padding, gap, and background colors for improved UI consistency
* Update background color for quick input header and run script action widget; refine localization strings for clarity
* Update background color for quick input header and run script action widget for improved visual consistency
* Refactor padding in quick input titlebar for improved layout consistency
* Update background color for quick input header and run script action widget for improved visual consistency
* style: update task labels to include ellipsis for consistency
* style: remove unused styles for quick-input-html-widget
* style: add overflow hidden to quick-input-html-widget for better layout
* style: add disabled state styles for run-script-action radio buttons
* style: update disabled state styles for run-script-action radio buttons and improve hint display
* style: add cursor default and focus outline removal for disabled radio buttons
* style: adjust margins for action bars in quick input widget and enhance custom command input functionality
* style: remove left margin for quick input left action bar in run-script-action widget
* style: adjust padding and margins for quick input titlebar and action items in run-script-action widget
* style: adjust padding for quick input titlebar and remove unnecessary margin styles in run-script-action widget
* sessions: remove ellipsis from Configure Task modal title
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: keep run-task menu open for item actions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add refresh functionality for dropdown menu in RunScriptActionViewItem
* Revert "feat: add refresh functionality for dropdown menu in RunScriptActionViewItem"
This reverts commit a7b7a0d935.
* Revert "sessions: keep run-task menu open for item actions"
This reverts commit 0b2e44b745.
* quickinput: revert no-op header padding shorthand
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add backdrop for run script action modal
* feat: streamline backdrop creation for run script action modal
* fix: increase padding in run script action widget for better spacing
* style: update run script action styles and class names for consistency
* fix: update tabIndex handling for storage options in RunScriptCustomTaskWidget
* fix: simplify storage options handling by enabling/disabling based on target lock state
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clear codeBlocksByResponseId, codeBlocksByEditorUri, fileTreesByResponseId,
and focusedFileTreesByResponseId when elements leave the viewport. These
maps are only read for the focused response which is always visible, so
retaining entries for off-screen elements is unnecessary memory usage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: change description type to IMarkdownString and render it
- Change ISessionData, IChat, and ISession description field types from
string | undefined to IMarkdownString | undefined
- Update all provider implementations (CopilotCLISession, RemoteNewSession,
AgentSessionAdapter, RemoteSessionAdapter) to use IMarkdownString
- In AgentSessionAdapter._extractDescription, wrap plain strings in
MarkdownString; IMarkdownString values are passed through as-is
- In sessionsList.ts, render markdown descriptions using markdownRendererService
with sanitizerConfig: { replaceWithPlaintext: true } — matching the existing
agentSessionsViewer.ts pattern; fallback status labels use plain textContent
- Add MutableDisposable to track the markdown render lifecycle so it is
properly cleared when status changes
- Update CSS to handle paragraph elements inside rendered markdown
- Update SESSIONS_PROVIDER.md documentation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* sessions: clear descriptionDisposable on plain-text fallback to avoid leaks
When the status is active (InProgress/NeedsInput/Error) but description
becomes undefined, the previous markdown renderer was left alive even though
its container element had been removed from the DOM by the autorun rebuild.
Fix: call descriptionDisposable.clear() in every else-branch (plain-text
fallback) so any prior IMarkdownRendererService render is disposed before
the new plain-text content is set.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: fix import of IsNewChatSessionContext after move to common/contextkeys.ts
Upstream commit moved IsNewChatSessionContext from sessionsManagementService.ts
to the centralised common/contextkeys.ts. Update the import in
sessionsTitleBarWidget.ts accordingly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Guard focus calls in NewChatViewPane and SessionsWelcomeOverlay
by checking IQuickInputService.currentQuickInput before focusing.
This prevents the sessions welcome page from closing an already
open quick pick (e.g. Open Recent) and stealing focus to the
chat input box.
Fixesmicrosoft/vscode#294505
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move RawContextKey definitions for active session state (provider ID, type,
background provider, git repository, chat session provider ID) from
sessionsManagementService.ts and copilotChatSessionsActions.ts into the
shared sessions/common/contextkeys.ts module. Replace hardcoded context
key strings with .key property access in all consumers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: fix Show All Sessions filter out of sync with view on reload
The IsWorkspaceGroupCappedContext context key was never initialized from
persisted storage on reload, causing the menu checkmark to always show
as checked (default true) regardless of the stored value.
Fix by binding the context key in the constructor and syncing it with
the persisted SessionsList state in renderBody. Also fix the Reset
action which was resetting the internal state but not the context key.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* use sessionsControl as source of truth for reset context key
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The chat input on the Agent Sessions welcome page would collapse from
~44px to ~22px after the first character typed, hiding the text.
Root cause: ChatWidget.layout() reserves MIN_LIST_HEIGHT (50px) for the
chat list even when the welcome page hides it via CSS. With a layout
height of 150px, the remaining budget for the input part was only 100px.
Once the input part's non-editor chrome (~128px for toolbars, padding,
attachments) was subtracted, _effectiveInputEditorMaxHeight dropped to 0,
collapsing the editor.
Fix: call setInputPartMaxHeightOverride(272) before layout so the input
part has enough budget independent of the artificially small layout
height. This mirrors what other compact chat surfaces (e.g. stacked chat
view) already do.
Fixes#304544
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sessions: fix title bar context menu and session icons
- Fix Unpin action missing from title bar context menu by looking up
actual pinned state via SessionsView instead of hardcoding false
- Remove context menu for new/unsent sessions where actions like
delete, pin, and archive don't apply
- Use session type icons (Codicon.copilot, Codicon.cloud) for
AgentSessionAdapter instead of provider-level icons
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* quickinput: expose alignment observable, keep Command Center visible when Quick Pick is dragged
When the Quick Pick is dragged away from its default top position, the
Command Center in the title bar no longer hides. Previously it always
hid on Quick Pick show, even when the widget was in a custom position
where it wouldn't overlap.
Changes:
- Add QuickInputAlignment type ('top' | 'center' | 'custom') and
alignment observable to IQuickInputService
- DnD controller tracks alignment via _setAlignmentState() helper that
updates both the context key and the observable
- Each service layer has a stable observableValue mirrored via autorun
(avoids breaking subscriptions on lazy controller creation)
- Command Center uses autorun to reactively show/hide based on alignment
- Fix onShowEmitter.fire() timing (moved after layoutContainer so
alignment is settled before listeners fire)
- Fix top===0 truthiness bugs in layoutContainer and updateLayout
- Fix double-click reset not updating alignment state
Fixes#306138
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* quickinput: handle anchored inputs and partial state in alignment
- Set alignment to 'custom' for anchored quick inputs (positioned near
a DOM element, not at the top)
- Re-sync alignment from DnD controller on non-anchored show to prevent
stale 'custom' value after an anchored input closes
- Guard setAlignment() to no-op while an anchored input is visible
- DnD alignment typed as IObservable<QuickInputAlignment> (read-only)
- Require both top and left in persisted state before marking as custom
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>