When pillRect.width < idealIconAreaWidth (22px) and lineNumbersWidth is 0,
the expression pillRect.width - idealIconAreaWidth produces a negative value.
Math.min then selects this negative widthUntilLineNumberEnd, which causes
pillRect.withWidth(negative) to create a Rect where left > right, throwing
'Invalid arguments: Horizontally offset by N'.
Wrap the computation in Math.max(0, ...) so widthUntilLineNumberEnd is
clamped to 0 when the pill is too narrow.
Fixesmicrosoft/vscode#301197
Move per-widget configurationService.onDidChangeConfiguration listener
to a single listener on the ChatListWidget container. Each
InlineAnchorWidget previously registered its own listener to toggle a
link-style CSS class, causing a listener leak warning when 175+ widgets
existed in a session.
The fix uses a parent container class (chat-inline-references-link-style)
toggled by a single listener, with CSS descendant selectors to style all
child widgets.
Fixes#301185
The disabled Claude Code hooks notification was tracked with a
workspace-scoped storage flag that was always set on the first
sendRequest call, even when hasDisabledClaudeHooks was false.
In the setup agent flow, the user's request is processed by SetupAgent
(which calls sendRequestInternal) before the extension is ready. This
caused the flag to be set before the real request was resent via
chatService.resendRequest. By the time the real request ran, the flag
was already true so the hint was silently skipped.
Fix: move the storage write inside the hasDisabledClaudeHooks check so
the flag is only set when the hint is actually shown.
Fixesmicrosoft/vscode#295079
Co-authored-by: not-roblourens <78992265+not-roblourens@users.noreply.github.com>
* 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
* 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>
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
* 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>
- Add AgentHostNewSession class for agent host sessions (never disabled,
standard model/mode picker, no repo/isolation/cloud pickers)
- Add isAgentHostTarget() helper to identify agent host session types
- Route agent host targets to AgentHostNewSession in createNewSessionForTarget
- Make model picker target-aware so agent host models appear correctly
- Guard remote agent host registration to copilot provider only
- Move local AgentHostContribution to separate contribution file so it
only runs in VS Code, not in the Sessions app
- Remove local agentHostService import from sessions desktop entry point
(Written by Copilot)
* 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
* 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>
* 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>
- Updates js-debug extension from version 1.110.0 to 1.112.0
- Updates corresponding sha256 hash for verification
(Commit message generated by Copilot)