Commit Graph

148425 Commits

Author SHA1 Message Date
Rob Lourens
86ffb98fc5 Minor chat optimizations (#301752)
* Small ChatModel optimizations
Identified by copilot
1. Lazy _responseRepr — Changed from eagerly rebuilt on every streaming token to computed on demand in toString(). This avoids running the expensive partsToRepr() (which iterates all parts and builds strings) on every incoming token during streaming. It's only computed when actually needed (copy, accessibility, telemetry, history).
2. Lazy _markdownContent — Same pattern: computed on demand in getMarkdown(). During streaming, getMarkdown() is called via countWords() in the view model, but crucially the string is only built once per invalidation cycle rather than eagerly on every updateContent call. If multiple parts are updated before getMarkdown() is accessed, only one computation happens.
3. _invalidateRepr() — New method that simply sets both cached strings to undefined, replacing the old _updateRepr() which did the expensive computation.
4. Response._contentChanged(quiet?) — Replaces the old _updateRepr(quiet?) override. Calls _invalidateRepr() and fires the change event when not quiet. The citation append logic moved into a computeRepr() override so it's part of the lazy computation.

* Fix leak on LabelWithHighlights

* Fix leak in chat thinking part. The titleDetailPart is just for consistency

* More optimizations
2026-03-14 13:45:04 -07:00
Joaquín Ruales
9ff90846b8 Add "Workbench > Browser" settings category (#301640)
Add Workbench > Browser settings category

Move workbench.browser.* settings into their own sub-category
in the Settings panel table of contents.
2026-03-14 13:35:09 -07:00
Rob Lourens
d11f5a4441 Expose chat.resizeImage command (#301734)
* Expose chat.resizeImage command

* Unwrap buffer
2026-03-14 18:44:40 +00:00
Peng Lyu
c770f37937 Enhance image handling in chat attachments (#301657)
* Enhance image handling in chat attachments

- Introduced coerceImageBuffer function to standardize image data handling.
- Updated ImageAttachmentWidget to utilize coerced image data for carousel display.
- Enhanced collectCarouselSections to merge request and response images.
- Added extractImagesFromChatRequest function for extracting user-attached images.
- Expanded test coverage for image extraction and carousel section collection.

* resolve comments.

* Refine image extraction details in AGENTS.md for clarity and accuracy

---------

Co-authored-by: Justin Chen <54879025+justschen@users.noreply.github.com>
2026-03-14 11:22:31 -07:00
Matt Bierner
cc2560ed75 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-14 11:21:36 -07:00
Matt Bierner
f4756bde52 Add test file updates too 2026-03-14 11:17:14 -07:00
Matt Bierner
36607d4313 Reapply #301598 with fixes
Fixes #301677

We need to pass the cancellation token as the last param for main thread <-> ext host or else it doesn't get revived, so any callers checking it would fail
2026-03-14 11:14:50 -07:00
Benjamin Pasero
e7297327c8 compile leftover (#301670) 2026-03-14 01:47:48 -07:00
Benjamin Pasero
3d2f6d9449 Revert "Pass through the initial options on creation" (#301676) 2026-03-14 08:46:55 +00:00
Josh Spicer
09f4d8ca32 Fix delete action in AI Customizations editor (#301630)
* Fix delete action visibility for read-only customizations

- Add context key overlays (type, storage, URI) when rendering list
  items and context menus so when-clauses are properly evaluated
- Add when-clause to delete menu items: hide for extension, plugin,
  and built-in storage types
- Update delete action handler to also block BUILTIN_STORAGE items
- Move item context key constants to shared aiCustomizationManagement.ts
- Fixes Run Prompt and Reveal in OS actions that were also broken
  because the context keys were never set on the scoped service

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

* Fix delete failing when telemetry throws and trash is unsupported

Two issues caused the delete action to silently fail:

1. The telemetry call (publicLog2) was throwing an exception that
   propagated uncaught, preventing the fileService.del() call from
   ever executing. Wrap telemetry in try/catch so it cannot block
   deletion.

2. fileService.del() was called with useTrash: true unconditionally,
   but some file system providers don't support trash, causing an
   error. Check hasCapability() before choosing useTrash.

Fixes both the management editor and sessions tree view delete actions.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 20:53:25 -07:00
Vijay Upadya
970a8d3bb5 Agent Debug: Make treeview default (#301637)
make treeview default
2026-03-13 18:38:54 -07:00
Paul
5fdf97cae5 Support markdown fallback in agent debug panel (#301634) 2026-03-13 18:19:54 -07:00
dependabot[bot]
be855d27b8 build(deps): bump undici from 7.18.2 to 7.24.0 (#301624)
Bumps [undici](https://github.com/nodejs/undici) from 7.18.2 to 7.24.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.18.2...v7.24.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.24.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-13 17:52:39 -07:00
Paul
9192689d93 Misc debug panel UX fixes (#301628) 2026-03-14 00:22:07 +00:00
Matt Bierner
51f27db1ba Merge pull request #301626 from mjbvz/dev/mjbvz/big-starfish
Make sure we use `isEqual` to compare uris in chat
2026-03-13 16:46:28 -07:00
Tyler James Leonhardt
4c822235d6 Implement image carousel service and integrate with chat attachments (#301587)
* Implement image carousel service and integrate with chat attachments

- Introduced `ChatImageCarouselService` to manage image carousels in chat.
- Updated `ImageAttachmentWidget` to utilize the new carousel service for image display.
- Enhanced image extraction logic to support inline references and tool invocations.
- Added tests for carousel service functionality and image extraction.

What's missing is pills rendered in other places like `pastTenseMessage` and `invocationMessage`... maybe more?

* Support past tense & invocation message

* feedback
2026-03-13 23:23:49 +00:00
Kyle Cutler
d9582784f6 Browser button in title bar (#301622) 2026-03-13 23:20:32 +00:00
Matt Bierner
6b8b037682 Make sure we use isEqual to compare uris in chat
Trying to track down cases where we lose the todos or edits. These don't seem like the exact cause but are worth fixing too
2026-03-13 16:13:37 -07:00
Matt Bierner
55fe9abad4 Merge pull request #301596 from mjbvz/dev/mjbvz/joyous-peacock
Use markdownDescription for a few more settings
2026-03-13 16:07:52 -07:00
Josh Spicer
13f5fab78d sessions: Generate New Action... (#301604)
* feat: add prompt for adding a run action to the current session

* feat: enhance run script action with Copilot assistance option

* feat: update Copilot prompt handling in run script action

* feat: update accessibility options and placeholder types in monaco editor

* feat: rename Copilot action label and description for clarity

* feat: add generate new action option via Copilot in run script action

* Fix 'Generate New Action...' on new session page

On the new session page, chatService.sendRequest() cannot be used because
the chat session hasn't been initialized yet. Detect isUntitled sessions and
route through NewChatViewPane.sendQuery() instead, which sets the editor
value and triggers the normal _send() flow (including slash command expansion).

Also adds prefillInput/sendQuery public methods to NewChatWidget and
NewChatViewPane, and injects IViewsService into RunScriptContribution.

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

* Rename slash command to /generate-run-commands and improve prompt

- Rename add-run-action.prompt.md → generate-run-commands.prompt.md
- Update runScriptAction.ts to send /generate-run-commands
- Rewrite prompt with:
  - Two task schema fields: inSessions (required) and
    runOptions.runOn: worktreeCreated (optional, for setup commands)
  - Smart inference: reads project files to determine commands;
    only asks the user if ambiguous
  - Modify mode: if run commands already exist, treat as an update
  - Merge-safe: always preserves existing tasks.json entries

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

* tidy

* Clear editor after successful send on new session page

After sendRequestForNewSession completes successfully, clear the editor
value so it doesn't persist when the user navigates back to a new session.

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

* Fix prompt not activating: use chatWidget.acceptInput() for active sessions

chatService.sendRequest() bypasses the chat widget's prompt file resolution
logic (_applyPromptFileIfSet). Use IChatWidgetService.getWidgetBySessionResource()
and call acceptInput('/generate-run-commands') instead, which goes through
the full input pipeline including slash command parsing and prompt file
attachment.

Also removes now-unused IChatService and ChatAgentLocation imports.

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

* Add new prompt for adding run actions

* Potential fix for pull request finding

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

* tidy

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-13 16:03:48 -07:00
Josh Spicer
2c43738efa sessions: built-in skills (#301607)
* sessions: add built-in skills infrastructure

Add a 'built-in skills' concept mirroring the existing 'built-in prompts'
pattern, so that skills bundled with the Sessions app are always available.

- Create src/vs/sessions/skills/ directory for bundled SKILL.md files
- Bundle vs/sessions/skills/**/SKILL.md in build config
- AgenticPromptsService: discover and parse built-in skills from the
  bundled directory, override findAgentSkills() to merge them at lowest
  priority (user/workspace skills override by name), extend listPromptFiles
  and listPromptFilesForStorage for skill type
- Tree view: handle BUILTIN_STORAGE group for skills category

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

* sessions: add built-in 'update-skills' skill

First built-in skill that guides the agent to capture major repository
learnings by creating or updating skills and instructions. Triggered
when the user says 'learn!' or when significant reusable knowledge is
discovered during a session.

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

* sessions: support edit-and-save-to-override for built-in skills

Extend the built-in prompt save-to-override flow to also work for
built-in skills. When editing a built-in skill, users can save it to
workspace or user location, which overrides the built-in version.

- Gate the in-memory editing session on both prompt and skill types
- Resolve save target directories using the actual prompt type
- Preserve skill directory structure ({name}/SKILL.md) when saving
- Generalize UI labels from 'prompt override' to 'override'

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

* sessions: address PR review feedback for built-in skills

- Sanitize built-in skill name/description (strip XML tags, truncate)
  to match the same safety applied to other skill sources
- Fix JSDoc: all sources override built-ins, not just user/workspace
- Remove unnecessary 'as unknown as PromptsStorage' cast in tree view

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

* sessions: refine editor options types for accessibility and font settings

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 16:03:37 -07:00
Connor Peet
8ff4db04fe build: bump js-debug to 1.112.0 (#301615)
- Updates js-debug extension from version 1.110.0 to 1.112.0
- Updates corresponding sha256 hash for verification

(Commit message generated by Copilot)
2026-03-13 16:00:26 -07:00
Paul
75282c3fef Add feature flag for agent debug experience (#301528) 2026-03-13 22:57:08 +00:00
Matt Bierner
ae5595b661 Merge pull request #301598 from mjbvz/dev/mjbvz/ill-owl
Pass through the initial options on creation
2026-03-13 15:39:35 -07:00
Vijay Upadya
fde89f1421 Rename chat debug to agent debug logs (#301602)
* Rename to agent debug logs

* renames

* ren
2026-03-13 21:59:31 +00:00
Peng Lyu
1037a025e9 Enhance LanguageModelToolsService to handle image file widgets in tool invocation messages (#301595)
* Enhance LanguageModelToolsService to handle image file widgets in tool invocation messages

* resolve comments.
2026-03-13 21:50:12 +00:00
Osvaldo Ortega
3711620339 Merge pull request #301589 from microsoft/copilot/fashionable-chinchilla
Fix session badge visibility when grouped by repository
2026-03-13 14:42:10 -07:00
Megan Rogge
a418daa4dc constrain questions (#301543)
fix #301518
2026-03-13 14:26:05 -07:00
dileepyavan
0cb8d31bc8 [Terminal_sandbox] Notify when user consent is needed for permissions in sandbox. (#301413)
* Add experiment mode to terminal sandbox

* Updating regex to extract file name

* migrating to sandbox manager from srt

* updating the regex for picking folder paths

* updating the regex for picking folder paths

* correcting the code layers

* Potential fix for pull request finding

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

* refactor

* refactor

* changes

* changes

* refactor

* refactor

* fixing tests

* fixing tests

* fixing tests

* test cases fix

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-13 14:22:18 -07:00
Justin Chen
9a8a72c414 parse content for image and display in terminal tool calls (#301560)
* parse content for image and display

* render images from terminal results

* reuse extraction logic

* better path
2026-03-13 14:22:01 -07:00
Osvaldo Ortega
74f1f6294d Serialize whole session object in log for better debugging
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 14:12:33 -07:00
Osvaldo Ortega
bad6d6e993 Use string args in log to ensure full object visibility
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 14:11:17 -07:00
Kyle Cutler
014f2af1f4 Fix find widget being hidden behind browser (#301579) 2026-03-13 14:09:42 -07:00
Matt Bierner
a3e296149d Pass through the initial options on creation
Make sure we pass these to callers in the new session flow too
2026-03-13 14:01:50 -07:00
Ladislau Szomoru
faa20ca100 Sessions - increase default width of the auxiliary sidebar (#301585) 2026-03-13 20:46:18 +00:00
Osvaldo Ortega
c76dedd3ed Revert unrelated monaco.d.ts changes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 13:27:51 -07:00
Osvaldo Ortega
06f371789c Update accessibility options and enhance session badge visibility for archived sessions 2026-03-13 13:25:45 -07:00
Josh Spicer
d05cd99050 Show directory picker when creating customizations with multiple source folders (#301250)
* feat: auto-select single source folder in prompt selection

* Show directory picker when creating customizations with multiple source folders

When the Sessions app creates a new customization (agent, skill,
instructions, prompt), the target directory was always auto-resolved
to the first default location (e.g., .github/agents). This ignored
that the system may be reading from multiple directories (e.g.,
.github/agents and .claude/agents).

Now, if multiple source folders exist for the target storage type,
a quick pick is shown to let the user choose. If only one folder
exists, it is used directly without prompting.

This applies to both the manual creation flow (createNewItemManual)
and the AI-guided creation flow (createWithAI) in the management
editor.

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

* fix: update accessibilitySupport and fontInfo types to any, and placeholder type to string | undefined

* Fix regression: pass undefined targetDir through to command

When no matching folder exists for the requested storage type (e.g.
skills have no user-storage folder), the previous code silently
aborted. The original behavior passed undefined through, letting
the command show its own folder picker via askForPromptSourceFolder.

Use null to signal user cancellation (dismiss picker) vs undefined
to signal no folder available. Also address review feedback:
- Use folder directly when length=1 in customizationCreatorService
- Use generic localized placeholder string
- Revert unrelated askForPromptSourceFolder.ts change

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

* Filter workspace picker to project root children only

getSourceFolders() tags tilde-expanded user paths (e.g. ~/.claude/agents)
as PromptsStorage.local, causing them to appear in the workspace picker.
Filter local folders to only those under the active project root so only
actual workspace directories are shown.

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

* Add 'New AGENTS.md' option to Instructions dropdown in Sessions

When in the Instructions section of the Sessions app, the + button
dropdown now includes a 'New AGENTS.md' option that creates the file
at the workspace root. Uses the AGENT_MD_FILENAME constant from
promptFileLocations.ts — no hardcoded filenames.

If the file already exists, it opens it in the embedded editor.

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

* Fix: prevent unfiltered folder picker when no matching storage exists

When the user clicks 'New Skill (User)' but no user-storage folder
exists for skills, the fallback returned undefined which was passed
through to the command. The command's askForPromptSourceFolder then
showed ALL folders including workspace-scoped ones.

Now when both the storage filter and the legacy fallback return
nothing, we return null (cancellation) instead of undefined
(pass-through), preventing the unfiltered picker from appearing.

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

* Fix: use project root as boundary instead of unreliable storage tags

The storage tags from getSourceFolders() are unreliable — tilde-expanded
user paths like ~/.copilot/skills get tagged PromptsStorage.local by
getConfigBasedSourceFolders(). This caused the user picker to show
workspace folders and vice versa.

Instead, partition folders by whether they're under the active project
root: children of project root are workspace, everything else is user.
This correctly handles all customization types including skills.

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

* Fix duplicate user dirs: prefer ~/.copilot as creation target

getSourceFolders() returns both ~/.claude/agents and ~/.copilot/agents
for user targets. The Sessions app's canonical creation target is
~/.copilot (per AgenticPromptsService design). Use the workspace
service's first includedUserFileRoot (~/.copilot) to filter user
folders for creation, and deduplicate by URI to remove duplicates
from config-based and override sources.

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

* Show all user targets, just deduplicate by URI

Don't filter out user directories — show everything we read from.
The only issue was duplicates (e.g. ~/.copilot/agents appearing twice
from config-based and override sources), which the URI dedup handles.

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

* Address review feedback: dedup, telemetry, empty folder handling

- customizationCreatorService: deduplicate workspace folders by URI
  before length checks to avoid unnecessary picker with duplicates
- managementEditor: normalize workspace-root to workspace in telemetry
  to avoid breaking the documented schema
- managementEditor: return undefined (not null) when no matching folders
  exist, so the command can fall back to askForPromptSourceFolder

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

* Fix: update accessibilitySupport and fontInfo types to any, and placeholder type to string | undefined

* Remove monaco.d.ts from branch diff

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 21:20:23 +01:00
Joaquín Ruales
dd301c4469 Browser: more improvements to Zoom (#301400)
* sync workbench zoom earlier to avoid visible zoom change

* Add zoom pill and URL ellipsis overflow

* Improve screen reader label
2026-03-13 13:16:30 -07:00
Osvaldo Ortega
5ad2b7fcd1 Add logging for repository name resolution in AgentSessionsDataSource and AgentSessionsControl 2026-03-13 13:09:38 -07:00
Osvaldo Ortega
b6c2e2e6f0 Add tests for getRepositoryName function in AgentSessionsDataSource 2026-03-13 13:05:21 -07:00
Osvaldo Ortega
f73808e08c Refactor repository name extraction logic in AgentSessionRenderer and related functions 2026-03-13 12:59:09 -07:00
Tyler James Leonhardt
630597864f Refactor session handling in ChatService to capture session options before loading remote sessions (#301557)
* Refactor session handling in ChatService to capture session options before loading remote sessions

This makes sure `initialSessionOptions` is defined during the request handler.

* add tests
2026-03-13 19:52:32 +00:00
Peng Lyu
bc8b9ba770 Merge pull request #301546 from microsoft/rebornix/steep-antlion
add toolResultDetails to ScreenshotBrowserTool for enhanced output handling
2026-03-13 12:19:52 -07:00
Don Jayamanne
f4b5798b5f Migrate queued requests when swapping sessions (for CLI) (#301379)
* Migrate queued requests when swapping sessions (for CLI)

* add tests

* Potential fix for pull request finding

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

* Fix tests

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-13 11:54:44 -07:00
Megan Rogge
045e2da42d Strengthen accessibility skill language (#301555) 2026-03-13 18:42:51 +00:00
Ben Villalobos
894acd3ec7 Allow vs-code-engineering bot to update distro field in package.json (#301218) 2026-03-13 11:40:01 -07:00
Copilot
b14be9a32d Fix agent-run tasks incorrectly prompting user with "press any key" input request (#301536)
* Initial plan

* Fix agent-run tasks incorrectly prompting "press any key" input request

Remove the `isTaskInactive` check in `OutputMonitor._handleIdleState()`.
When the execution is a task and the output contains a VS Code task finish
message, always treat it as a stop signal regardless of the task's active
state (which can be stale from `getBusyTasks()`). The generic "press any
key" prompt is now only shown for non-task executions.

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
2026-03-13 18:39:23 +00:00
Megan Rogge
83c783c9ba trim leading slash from terminal commands (#301550) 2026-03-13 11:39:04 -07:00
Matt Bierner
5ca0ea581f Use markdownDescription for a few more settings
Let's us use inline code elements on these
2026-03-13 11:35:58 -07:00