Commit Graph

421 Commits

Author SHA1 Message Date
Eleanor Boyd
d1bae8a836 enhance model selection logic to use location based defaults and bring back session model section tracking (#289993)
* enhance model selection logic to use location based defaults and bring back session model section tracking

* handle comments

* cleanup

* comments addressed
2026-01-27 07:12:18 +00:00
Copilot
4de5008c32 Support model as string[] in custom agent definitions (#289655)
* Initial plan

* Support model as string or string[] in custom agents

- Updated ICustomAgent.model to support string | string[] | undefined
- Updated IChatModeData.model and IChatMode.model accordingly
- Added getStringOrStringArrayAttribute method in PromptHeader
- Updated validateModel in promptValidator to handle both string and array types
- Added comprehensive tests for model array validation

Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>

* Support model as string or string[] in custom agents - verified

- All code compiles successfully with 0 errors
- Tests verified to compile and be comprehensive
- Backward compatible with single string models
- Type-safe implementation with proper validation

Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>

* Fix: Include empty strings in model array parsing

- Updated getStringOrStringArrayAttribute to include empty strings
- Allows downstream validation to catch empty string errors
- Addresses code review feedback

Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>

* Fix: Update model validation in isCachedChatModeData to allow arrays

- Modified isCachedChatModeData to validate model as string | string[]
- Fixes test failures related to cached mode data validation
- All chat tests now passing

Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>

* update

* add lookupLanguageModelByQualifiedName

* fix completion and hover

* Update src/vs/workbench/contrib/chat/common/languageModels.ts

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

* fix test

* update

* update

* fix

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-26 14:51:26 +00:00
eleanorjboyd
4a6e1b5da5 remove store 2026-01-22 13:01:57 -08:00
eleanorjboyd
df9e0bea2d fix to logging 2026-01-22 07:52:58 -08:00
eleanorjboyd
220c6f18bb Refactor for improved maintainability 2026-01-21 23:02:36 -08:00
eleanorjboyd
219cf91710 New setting for inlinechat.defaultModel 2026-01-21 17:53:18 -08:00
Johannes
61e55c38b2 refactor(inlineChat): rename overlay widget classes and update references
feat(inlineChat): enhance overlay widget positioning and visibility handling
fix(inlineChat): adjust CSS for session overlay progress message
2026-01-21 17:03:17 +01:00
Johannes
09050dd122 feat(inlineChat): add inline chat session overlay and progress handling 2026-01-21 15:48:44 +01:00
Johannes
6ba5c9d738 refactor(inlineChat): rename InlineChatOverlayWidget to InlineChatInputOverlayWidget and update references 2026-01-21 11:55:19 +01:00
Johannes Rieken
90bae3ca47 feat(inlineChat): refactor inline chat affordance and rendering modes (#289159)
* feat(inlineChat): refactor inline chat affordance and rendering modes

- Replaced InlineChatSelectionIndicator with InlineChatAffordance for improved affordance handling.
- Introduced InlineChatGutterAffordance and InlineChatEditorAffordance for gutter and editor affordances respectively.
- Added InlineChatOverlayWidget for rendering inline chat as a hover overlay.
- Updated configuration keys to support new affordance options and rendering modes.
- Removed deprecated ShowGutterMenu configuration in favor of more flexible affordance settings.
- Enhanced inline chat behavior to support both zone and hover rendering modes.

* thanks copilot
2026-01-21 07:57:05 +00:00
Johannes Rieken
0292f07476 Gutter inline edit menu (#287103)
* WIP - edit gutter

* ignore empty selections

* tweaks

* wip

* wip

* wip

* proper menu, custom view item with edtor

* wip

* add setting

* Make it inlineChat.showGutterMenu, noZone etc pp

* polish

* use `IChatEntiteldService.sentiment.hidden`

* Add inline chat gutter visibility context and menu actions

* Add inline gutter menu proposal for chat editor

* fix progress message for the overlay

* Add inline chat gutter menu overlay widget and styles

* cleanup

* Refactor inline chat gutter code: remove unused styles and streamline action handling

* Simplify focus tracking logic in inline chat gutter menu widget

* Enhance inline chat gutter menu: improve input handling and dynamic height adjustment
2026-01-19 18:33:34 +01:00
Sandeep Somavarapu
82352d9ab5 do not show copilot models if they are not user selectable (#288078) 2026-01-15 15:02:43 +00:00
Johannes Rieken
472a1bb130 fix how _selectVendorDefaultLanguageModel is set (#287804) 2026-01-14 16:13:31 +00:00
Johannes Rieken
23f6c25c9b Allow vscode.LanguageModelChatInformation#isDefault to be per chat location (#287527)
We have `isDefault` which allows a model to indicate that it is the best/most-recommended model. This PR extends this concept to define default by location, e.g for inline chat a different default model might apply than for panel chat or terminal chat
2026-01-13 10:45:38 -05:00
Johannes Rieken
9d62a24f48 Make inline chat fallback to the default model of selected vendor (#287244)
This makes sure inline chat uses the model the vendor/extension recommends. Also makes sure folks aren't stuck on an old model selection. This can be disabled (via setting) and a custom selection will be honoured for the duration of a vscode session (lifetime of a window)

https://github.com/microsoft/vscode-internalbacklog/issues/6544
2026-01-13 09:45:59 +00:00
Johannes Rieken
70fcd02c91 fix leaking inline chat widget (#287231) 2026-01-13 07:57:19 +00:00
Johannes Rieken
e76e5a9069 Revert "Add inlineChat.persistModelChoice setting" (#287135)
This reverts commit f345afbb17.
2026-01-12 17:29:34 +00:00
Johannes
f345afbb17 Add inlineChat.persistModelChoice setting
This setting allows to control if the inline chat model choice is persisted. The default is `false` (do not persist model choice) because we see many users sticking around with old, less good models.

re https://github.com/microsoft/vscode-internalbacklog/issues/6544
2026-01-12 13:54:05 +01:00
Johannes Rieken
9d3ba969a8 fix support for inline eval (#286552)
* fix support for inline eval

* thank you padawan
2026-01-08 16:11:17 +00:00
Johannes Rieken
74195430ca debt - remove old inline chat world (#286503)
fixes https://github.com/microsoft/vscode/issues/282015
2026-01-08 10:12:31 +00:00
Aaron Munger
5d583ada12 use v2 controller with old notebook prompt (#284160)
* use v2 controller with old notebook prompt

* fix cell edit creation, dont re-open notebooks

* v1 enabled will never be true
2026-01-06 09:37:05 +11:00
Rob Lourens
99d8a2706e Reorganize workbench/contrib/chat (#285467)
* Move some tools files

* chat/accessibility

* Fix this

* Move model files into model/

* Move tool invocation into model/

* Move builtinTools under tools/

* Add common/ui/ folder

* attachments/ and participants/

* browser/widget/ folder

* attachments/ and tools/

* widgetHosts/

* widget/modelPcker/ and context/

* Doc and more organizing

* widget/input/

* widget/chatContentParts/

* More cleanup in common/

* Tweak docs, move a file

* Break up contrib/ folder

* Fix test/ files
2025-12-31 13:02:33 -08:00
Johannes Rieken
d2841596be Make sure not create widget eagerly, enforce editor to have a model when widget gets created (#283023)
https://github.com/microsoft/vscode/issues/283017
2025-12-12 12:23:50 +00:00
Johannes Rieken
97037ea763 fix https://github.com/microsoft/vscode/issues/278112 (#280964) 2025-12-03 14:49:00 +00:00
Johannes Rieken
e69c47a5a0 fixes https://github.com/microsoft/vscode/issues/280756 (#280919) 2025-12-03 11:34:18 +00:00
Johannes Rieken
ce9c9c3931 chore - have ChatRequestEditorData#editor and let it eventually replace document/selection/wholeRange (#280259) 2025-12-01 08:52:02 +00:00
Rob Lourens
8ccd1dae54 Some chat service cleanup (#280105)
* Clean up unused cancel token

* Simplify shouldBeInHistory

* Use real DisposableResourceMap
2025-11-30 13:58:18 +11:00
Johannes Rieken
b10b0bbae0 make sure inline chat restore state after switching files and but dismisses empty sessions (#280000)
* 💄

* make sure inline chat restore state after switching files and but dismisses empty sessions

fixes https://github.com/microsoft/vscode/issues/278060
2025-11-28 19:41:07 +01:00
Johannes Rieken
c426bc9e9a support modelSelector option when running inline chat (#279976)
https://github.com/microsoft/vscode-copilot-evaluation/issues/894
2025-11-28 14:51:19 +00:00
Johannes Rieken
b299fed13c show error details of failed requests in v2 UI (#279959)
re https://github.com/microsoft/vscode/issues/278065
2025-11-28 12:46:20 +01:00
Johannes Rieken
51eb8fbd82 show progress message (in placeholder place) (#279953)
re https://github.com/microsoft/vscode/issues/278057

also disables MCP via !canUseTools
2025-11-28 10:42:08 +00:00
Johannes Rieken
ca97995de9 don't filter confirmation bits from the UI (#279410)
https://github.com/microsoft/vscode/issues/279340
2025-11-25 18:02:23 +00:00
Rob Lourens
bbdd097bd3 Manage ChatModels with ref-counting, allow running in bg (#278476)
* Manage ChatModels with ref-counting, allow running in bg
Towards #277318

* Rename

* Clear widget viewmodel when editor is closed

* Cleanups

* Comment

* cleanup

* Ensure models disposed

* Revert file

* Fix tests
2025-11-21 05:24:50 +00:00
Johannes Rieken
aea5802acc Use correct location for inline chat (#278559)
* inline chat should use correct location and manually start the editing session

* remove `isGlobalEditingSession` from `startSession`
2025-11-20 11:23:24 +00:00
Connor Peet
9cf56d4ac7 chat: reduce mutability in ichatmodel (#278239)
refs https://github.com/microsoft/vscode/issues/277318
2025-11-19 11:11:47 -08:00
Connor Peet
ea4ccd5f44 chat: add requestNeedsInput on the chat model (#278171)
With a side quest that makes elicitations correctly trigger this, which
involved refactoring their state into an observable.

Also swap requestInProgress/Obs to a single requestInProgress observable.
Synchronous callers can just `.get()` it as needed.
2025-11-18 11:05:28 -08:00
Johannes Rieken
77becee660 Use new inline chat UI all the time (#278139)
* Don't read `inlineChat.enableV2` on the client anymore

The UI is now always the new way but the extension still supports both "back ends"

re https://github.com/microsoft/vscode/issues/278054

* handle graceful files, e.g from /test, graceful

* use artifical version number to make chat happy with code-oss
2025-11-18 16:34:39 +00:00
Connor Peet
798ef59100 chat: remove waitForReady (#277944)
* chat: remove `waitForReady`

- Now that edit sessions are sync, we don't need to wait for them (just
  guard edits) as in https://github.com/microsoft/vscode-copilot/issues/16060
- I noticed `widget.onDidClear()` listeners were actually async and we
  do need to wait for them before we can safely make new input. Revised
  this to a delegate pattern.
- Wait for a view model when sending chat. Also, improved Event.toPromise
  so it can safely be reused -- it now cleans up its own disposable from
  the disposable store or array after it settles.

Resolves #247484

* Update src/vs/base/common/event.ts

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-17 22:55:36 +00:00
Connor Peet
c74439554c chat: make creation of the edit session sync (#277924)
Uses the session state to wait in cases where it's needed

Refs #277318
2025-11-17 19:17:15 +00:00
Johannes Rieken
54a244f2f0 debt - streamlined accept/reject of inline chat sessions (#277424) 2025-11-14 15:36:55 +01:00
Johannes Rieken
79a06da95d fix https://github.com/microsoft/vscode/issues/275859 (#276521) 2025-11-10 15:50:10 +00:00
Johannes Rieken
a0f90b188c Bring back model picker for inline chat (#276041)
Revert "lock inline chat to its own agent so that must intellisense is disabled"

This reverts commit f04c75b832.
2025-11-07 10:34:57 +00:00
Johannes Rieken
99de6af65e lock inline chat to its own agent so that must intellisense is disabled (#275857)
fixes https://github.com/microsoft/vscode/issues/275819
2025-11-06 09:08:12 -08:00
Johannes Rieken
b855dad790 make sure inline chat shows again after switching tabs (#275534)
* fix https://github.com/microsoft/vscode/issues/275250

* make sure inline chat shows again after switching tabs
2025-11-05 11:31:47 +00:00
Johannes Rieken
ec7952e66e fixes https://github.com/microsoft/vscode/issues/274789 (#275520) 2025-11-05 11:23:34 +01:00
Matt Bierner
a1f7be35bf More sessionId -> sessionResource conversation
- Adopting for code blocks
- Switching to use safer `LocalChatSessionUri.parseLocalSessionId` in a few more spots
- Adopting for some contexts and a few more apis
2025-10-31 11:25:00 -07:00
Johannes Rieken
3628ca5516 Inline chat v2 UI work (#274338)
* disable auto-accept for inline chat

* hide inline chat via ESC more

* inline - render picker below input

* remove unneccessary v2 actions

* fix `Enter` to only accept from input when there is no new text typed

* custom placeholder, use prompt as placeholder while request is on

* no min width for inline chat widget
2025-10-31 12:54:32 +00:00
Matt Bierner
db5ee1e0f4 Convert ChatService to use uris instead of ids in public apis
Moves the chat service public APIs to use uris for identifying sessions instead of ids. These uris are preferred as they work correctly for both contributed and local session

This ends up touch a lot of the chat apis. In most cases, the change is simply to pass in the URI instead of the id. In a few cases where the URI hasn't been fully hooked up, I am using `LocalChatSessionUri` to do this conversation

For the chat session implementation, I also switched to use resource maps to store session specific information instead of a normal map
2025-10-30 17:38:33 -07:00
Johannes Rieken
35d4ea1cd2 Inline chat v2 updates (#273986)
* wip - have a tool that allows inline chat to escape

* wip

* improve move session

* inline chat v2 UI tweaks

* pick up "selected" diagnostics and add them as attachments

* show inline chat widget always above selection

* tweak inline escape tool

* remove `hideOnRequest`

* use `inlineChatApplyEdit` when using inline chat

* make sure to position zone above changes if otherwise inbetween

* 💄

* add logging

* * add inline v2 specific execute toolbar
* add the minimun number of command only
* add keep/discard commands

* Update src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-29 22:21:45 +00:00
Benjamin Pasero
672c1c1d94 chat - tweak wording around chat and reduce use of copilot (#272839) 2025-10-23 11:40:49 +00:00