* fix: exempt agent instructions from workspace subpath filter
AGENTS.md, CLAUDE.md, and copilot-instructions.md live at the workspace
root by design. The CLI harness restricts items to workspaceSubpaths
(.github, .copilot, .agents, .claude) which filtered out these root-level
agent instruction files. Now items with groupKey 'agent-instructions' are
exempt from the subpath filter, matching the existing exemption for
instructionFileFilter patterns.
* sessions: include AGENTS.md in instructions listing
The sessions AI customization tree view and overview were only calling
listPromptFiles(PromptsType.instructions) to discover instruction files.
However, AGENTS.md (along with CLAUDE.md and copilot-instructions.md)
is classified as an agent type by getPromptFileType(), so it was never
returned by that call.
Fix by also calling listAgentInstructions() and merging the results
(deduplicating by URI), matching the pattern already used by the
workbench customization editor.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add sequence counter to loadItems to prevent race conditions
Multiple concurrent loadItems() calls can overlap when autoruns fire
simultaneously. Without serialization, a slow earlier call can resolve
after the correct one and overwrite allItems with stale/empty results.
The sequence counter ensures only the latest call's result is applied.
* fix: add missing onDidChangeInstructions subscription
The list widget subscribed to onDidChangeCustomAgents,
onDidChangeSlashCommands, and onDidChangeSkills but not
onDidChangeInstructions. This meant instruction file discovery
completing after the initial load never triggered a widget refresh.
* fix: re-establish provider onDidChange when harness registers
The autorun that subscribes to itemProvider.onDidChange only read
activeHarness. If the harness ID was persisted from a previous session,
activeHarness never changed when the CLI harness registered, so the
subscription was never set up. Now also reads availableHarnesses to
re-fire when harnesses are added/removed.
* fix: add instruction groups to filterItemsForProvider
filterItemsForProvider only had storage-based groups (local, user,
extension, builtin). Provider-supplied instruction items have semantic
groupKey values like 'context-instructions' and 'on-demand-instructions'
which didn't match any group, causing all instruction items to be
silently dropped (allItems: 0). Add instruction-semantic groups when
the current section is Instructions, matching filterItemsForCore.
* fix: ignore customization provider API in sessions window
The sessions window manages its own harnesses via
SessionsCustomizationHarnessService and the remoteAgentHost
contribution. Extension-contributed harnesses via the provider API
should not be registered in the sessions window.
* sessions: use generic sign out confirmation copy (#307465)
Allow the shared account sign-out action to accept dialog copy overrides so the Agents app can show a generic confirmation instead of listing extension usage.
Adds a focused test for the override path while preserving the default workbench confirmation behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: scope sign out confirmation to Agents app (#307465)
Keep the Agents-specific sign-out confirmation flow inside the sessions account menu instead of extending the shared authentication sign-out action.
This restores the core workbench auth dialog behavior and limits the copy change to the sessions app surface.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Initial plan
* Fix clicking on settings link in bool setting toggles the checkbox
When a settings link is clicked in the description of a bool setting,
the MOUSE_DOWN handler was checking if `e.target.tagName === 'a'` to
avoid toggling the checkbox. However, settings links rendered by the
markdown renderer contain an SVG icon inside the `<a>` tag. Clicking
on the SVG makes `e.target` the SVG element (not the `<a>`), causing
the check to fail and incorrectly toggling the checkbox.
Fix by using `targetElement.closest('a')` which traverses up the DOM
tree to detect clicks within any ancestor `<a>` element.
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
* Fix type safety of e.target cast in bool setting MOUSE_DOWN handler
Use `instanceof Element` guard instead of casting to HTMLElement,
since clicks can originate from SVGElement/SVGPathElement. Also guard
against null before calling closest('a').
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/102850fa-98da-4c19-b23a-414cbe95323b
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Lower the sessions sidebar resize floor from 270px to 170px and keep the layout specification in sync with the final sessions app behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Append repository detail metadata, or fall back to the worktree folder name, in the sessions titlebar widget so active titles render as 'Title · repo (branch/worktree)'.
Also update the sessions layout spec to document the new title format.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: disable branch picker in folder mode
Keep the new chat branch picker visible when isolation switches to Folder, but disable it until Worktree is selected again. Also add regression coverage for the folder/worktree toggle and keep the disabled picker cursor consistent on hover.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: remove branch picker hover cursor tweak
Keep the branch picker behavior change, but drop the extra disabled hover cursor styling so the PR only contains the intended picker visibility/disabled-state update.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Sessions: preserve cancelled session content in list
When a session is stopped before the agent commits a worktree, keep it
in the sessions list with Completed status instead of removing it. This
lets the user review whatever content the agent produced before
cancellation.
- Use CancellationError in _waitForCommittedSession to distinguish
cancellation from unexpected failures
- On CancellationError in _sendFirstChat/_sendSubsequentChat, set
Completed status and fire a changed event instead of removing
- Add tests for committed-then-stopped and cancelled-before-commit flows
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: defer CancellationError until timeout, remove unused variable
- Move isCanceled check from the early-exit path to after the 5s
safety timeout so a late commit event (user stops after worktree was
initiated but before IPC finishes) is not missed.
- Remove unused changes variable in committed-session test.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentPlugins: clone locally when in a remote
The git extension runs on the remote side, so it's not suitable to use to clone. This just does it directly.
I would kind of like to just take this path in all cases since I previously had to add some internal commands in the git extension. But for now going into next release this only affects the remote case which was previously broken.
Closes#298701
* cleanup
* comments
* chat: add startup telemetry for live chat model counts
After reviving sessions with pending edits at startup, log telemetry
with the number of live chat models, how many are open in widgets,
how many are background-only, and how many are kept alive solely
because they have unaccepted edits.
- Expose whenSessionsRevived promise on IChatService
- Add browser-layer contribution that awaits revival + uses
IChatWidgetService to classify models without hard-coded strings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* address review: error handling, void fire-and-forget, referenceCount check
- Wrap reviveSessionsWithEdits with .catch() to avoid unhandled rejection
- Mark logTelemetry() as void fire-and-forget
- Check referenceCount === 1 for modelsKeptAliveOnlyForEdits
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wire installed agent plugins through the chatPromptFiles proposed API:
- Add ChatPluginResource interface with uri + label
- Add chat.plugins getter and chat.onDidChangePlugins event
- Add IPluginDto and $acceptPlugins to ext host protocol
- Push plugins from mainThread via autorun on IAgentPluginService
- Inject IAgentPluginService into MainThreadChatAgents2