Sandeep Somavarapu e63efae792 sessions: quick chats (workspace-less sessions) in the Agents window (#323972)
* sessions: quick chats — workspace-less single-chat sessions

Adds quick chats to the Agents window: lightweight chats not scoped to a
workspace, backed by an agent-host session. The host infers workspace-less
from an absent workingDirectory (forks excluded) and assigns a stable scratch
dir; the workspaceless tag rides the generic _meta bag. Quick chats are
single-chat, use the normal session presentation (Done hidden), render in an
always-visible in-list "Chats" section, and persist across reloads.

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

* sessions: New from a quick chat opens another quick chat (Round 23)

The primary "New" action gated quick-chat routing on `isCreated &&
isQuickChat`, but a quick-chat draft is Untitled (isCreated=false), so it
fell through to the workspace composer seeded with a throwaway scratch dir
(no session-type picker, "No models available").

Route on `isQuickChat` alone so a quick chat — draft or committed — opens
another quick chat mirroring its harness. Extract the routing into a pure,
side-effect-free `openNewChatOrQuickChat` helper so it is unit-testable
(chat.contribution.ts is not test-importable). Supersedes Round 14(2) and
updates Round 22(3); the Round 14(2) discard branch and Round 17 picker
re-parent are kept as internal defense.

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

* sessions: quick-chat list & layout polish (Round 22 items 1-2)

- Suppress the redundant per-row chat icon when a quick chat is rendered
  under the always-visible "Chats" section (the section header already
  carries a chat icon); keep it in Pinned/custom/date groups where the
  chat identity is useful.
- Disable the "Toggle Side Panel" command for quick chats via
  precondition IsQuickChatSessionContext.negate(), since a quick chat has
  no side pane (the empty aux bar is hidden and the chat is full-width).

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

* agentHost: persist empty peer-chat catalog sentinel to avoid re-running legacy migration

When a session has no legacy peer chats, write an empty catalog so
_readPersistedPeerChatCatalog returns [] on subsequent restores and
_migrateLegacyPeerChats never re-runs.

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

* sessions: Cmd+N always creates a new session; New Quick Chat gets Cmd+K Cmd+N (Round 24)

Per user feedback, Cmd+N must always open a NEW SESSION — never a quick
chat. Drop the context-aware quick-chat routing from
NewChatInSessionsWindowAction (rename its title "New Chat" -> "New Session",
keep the id) so it unconditionally calls openNewSession from the active
session; the helper is renamed openNewChatOrQuickChat -> openNewSessionFromActive.

Quick chats are created only via the Chats-section "+" (NewQuickChatAction),
which now has a default Cmd+K Cmd+N chord. The peer-chat "+" (Cmd+T) is
unaffected. Supersedes the Round 22(3)/23 mirror routing; the Round 14(2)
discard branch and Round 17 picker re-parent are untouched.

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

* sessions: Cmd+N never inherits a quick chat's folder into the workspace composer (Round 25)

New from a quick chat must always land on the clean New Session composer with
a visible session-type picker. Gate openNewSessionFromActive's folder
inheritance on isQuickChat so a quick chat never carries a (possibly leaked
scratch) workspace URI into openNewSession.

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

* sessions: re-seed workspace draft when composer swaps out of quick-chat mode (Round 25b)

Cmd+N from a quick chat reuses the new-session composer and only
_activate(undefined), leaving it session-less. The session-type picker hides
itself when it has no folder types (no active session), so no picker showed.
Re-run the constructor's workspace-draft seed from an autorun when the composer
transitions out of quick-chat mode with no active session, matching a freshly
opened new-session composer (folder + visible picker).

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

* sessions: quick-chat untitled title falls back to "New Chat" via shared helper (Round 26)

An untitled quick chat's titlebar showed "New Session" because the empty-title
fallback was hardcoded and not quick-chat aware. Add getUntitledSessionTitle(isQuickChat)
to the common layer and route all 5 fallback sites (titlebar, session header x2,
list hover, sessions picker) through it.

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

* sessions: track isQuickChat in titlebar re-render autorun (Round 27)

The SessionsTitleBarWidget re-render autorun read the active session's
title and workspace but not isQuickChat, which _render() consumes for the
untitled title fallback. Track it as a reactive dependency for
forward-safety and consistency with other reactive render sites.

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

* agentHost: move workspace-less marker ownership to the AH service

Each agent used to persist and re-emit its own workspace-less (quick chat)
marker (copilot.workspaceless / claude.workspaceless) in the shared session
database, and agents that persist nothing (Codex) lost the marker on restart.

Make the AH service the single owner: AgentService persists a single
agentHost.workspaceless key at create/materialize (from the value it already
infers in _buildInitialSummary) and overlays _meta.workspaceless onto every
agent's summary in listSessions. Agents no longer write or namespace the
marker; Copilot reads the shared key for its resume system prompt, and the
now-dead workspace-less plumbing is removed from the Claude session. This
fixes restored quick chats for every agent (including Codex) with no
per-agent code.

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

* sessions/agentHost: address review feedback (naming + inline)

- Rename the workspace-less launch-plan flag from isQuickChat to
  workspaceless in CopilotSessionLaunchPlan and IAgentHostPromptContext (and
  the disposeSession local) so the flag matches the workspaceless marker it
  flows from throughout the AH layer. Feature-descriptive names
  (COPILOT_AGENT_HOST_QUICK_CHAT_INSTRUCTIONS, _quickChatScratchDir) are kept.
- Inline openNewSessionFromActive back into NewChatInSessionsWindowAction.run
  and remove the single-caller seam module + its test.

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

* agentHost: make the AH service the sole owner of the workspaceless marker

Following the earlier ownership move, the agents still read + re-emitted
_meta.workspaceless in their metadata projections, which was redundant on the
listSessions path (AgentService overlays it centrally) and only load-bearing
on the single-session restore path.

Centralize the restore overlay in AgentService.restoreSession (reads
agentHost.workspaceless in its existing batch metadata read and merges it into
the restored summary _meta), then drop the per-agent re-emit: remove it from
the Claude metadata store entirely (Claude has no runtime need) and from the
Copilot listSessions/getSessionMetadata projections. Copilot keeps reading the
AH key for its resume system prompt and scratch-dir cleanup. Codex is now
covered centrally with no Codex code.

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

* sessions: inline openQuickChatAndFocus into NewQuickChatAction

Single-caller helper folded into the action's run().

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

* sessions: make ISessionsProvider.createQuickChat mandatory

Replace the optional createQuickChat with a mandatory method that throws when
the provider does not support quick chats; callers now gate solely on the
supportsQuickChats capability instead of probing for the method. Workspace-bound
providers (Copilot chat, local chat) get an explicit throwing implementation.

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

* agentHost: use "workspace-less chat" terminology instead of "quick chat"

Rename the agent-host-internal quick-chat identifiers, prompt tags, and prose to
workspace-less: COPILOT_AGENT_HOST_QUICK_CHAT_INSTRUCTIONS ->
COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS, the <quick_chat> system-message
tag -> <workspaceless_chat>, and the scratch-dir helpers
(_quickChatScratchDir/_ensure*/_cleanup*/_withQuickChatScratch). The workbench
UI term "Quick Chat" is kept only where the agent host documents that mapping.

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

* sessions: address Copilot Code Review feedback on quick chats

- sessionsList: select the row chat icon from isQuickChatSession(), not from
  workspace === undefined, so a workspace session with a transiently-undefined
  workspace no longer briefly shows the chat icon.
- sessionContextKeys: correct the isQuickChat comment to reflect that the key
  is sourced from the isQuickChat tag, never inferred from workspace absence.
- Agents window accessibility help: document the New Quick Chat command
  (Cmd/Ctrl+K Cmd/Ctrl+N) and the Chats section plus button, and note that the
  workspace picker does not apply and Toggle Side Panel is disabled for quick chats.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 00:38:15 +00:00

Visual Studio Code - Open Source ("Code - OSS")

Feature Requests Bugs Gitter

The Repository

This repository ("Code - OSS") is where we (Microsoft) develop the Visual Studio Code product together with the community. Not only do we work on code and issues here, but we also publish our roadmap, monthly iteration plans, and our endgame plans. This source code is available to everyone under the standard MIT license.

Visual Studio Code

VS Code in action

Visual Studio Code is a distribution of the Code - OSS repository with Microsoft-specific customizations released under a traditional Microsoft product license.

Visual Studio Code combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.

Visual Studio Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on Visual Studio Code's website. To get the latest releases every day, install the Insiders build.

Contributing

There are many ways in which you can participate in this project, for example:

If you are interested in fixing issues and contributing directly to the code base, please see the document How to Contribute, which covers the following:

Feedback

See our wiki for a description of each of these channels and information on some other available community-driven channels.

Many of the core components and extensions to VS Code live in their own repositories on GitHub. For example, the node debug adapter and the mono debug adapter repositories are separate from each other. For a complete list, please visit the Related Projects page on our wiki.

Bundled Extensions

VS Code includes a set of built-in extensions located in the extensions folder, including grammars and snippets for many languages. Extensions that provide rich language support (inline suggestions, Go to Definition) for a language have the suffix language-features. For example, the json extension provides coloring for JSON and the json-language-features extension provides rich language support for JSON.

Development Container

This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.

  • For Dev Containers, use the Dev Containers: Clone Repository in Container Volume... command which creates a Docker volume for better disk I/O on macOS and Windows.

    • If you already have VS Code and Docker installed, you can also click here to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.
  • For Codespaces, install the GitHub Codespaces extension in VS Code, and use the Codespaces: Create New Codespace command.

Docker / the Codespace should have at least 4 cores and 6 GB of RAM (8 GB recommended) to run a full build. See the development container README for more information.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT license.

Description
2025-08-20 10:13:53 -05:00
Languages
TypeScript 77.6%
jsonc 18.1%
CSS 1.4%
JavaScript 0.7%
C 0.7%
Other 1.2%