Skip to content

sessions: fix ESLint dangerous type assertion in builtin prompts#299663

Merged
joshspicer merged 1 commit intosandy081/layout-explorationfrom
josh/fix-h
Mar 6, 2026
Merged

sessions: fix ESLint dangerous type assertion in builtin prompts#299663
joshspicer merged 1 commit intosandy081/layout-explorationfrom
josh/fix-h

Conversation

@joshspicer
Copy link
Member

Replace the as IPromptPath cast in discoverBuiltinPrompts with a createBuiltinPromptPath factory function that contains the type narrowing in one place, satisfying the code-no-dangerous-type-assertions ESLint rule.

Replace the `as IPromptPath` cast in discoverBuiltinPrompts with a
createBuiltinPromptPath factory function that contains the type
narrowing in one place, satisfying the code-no-dangerous-type-assertions
ESLint rule.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@joshspicer joshspicer merged commit f943842 into sandy081/layout-exploration Mar 6, 2026
3 checks passed
@joshspicer joshspicer deleted the josh/fix-h branch March 6, 2026 01:33
sandy081 added a commit that referenced this pull request Mar 6, 2026
* sessions - fix chat input shrinking at narrow widths (#299498)

style - set width to 100% for `interactive-input-part`

* modal - force focus into first modal editor always

* fix: update precondition for FixDiagnosticsAction and hide input widget on command execution (#299499)

fixes #299251

* refactor: remove workspace context service dependency from FolderPicker

* Add logging for agent feedback actions

* modal - some fixes to actions and layout

* modal - surface some editor actions in a new toolbar (#299582)

* modal - surface some editor actions in a new toolbar

* ccr

* keybindings - remove "Edit as JSON" as its now available from the title menu

* settings - remove "Edit as JSON" as its now available from the title menu

* update hover fixes

* terminal fixes

* terminal improvements

* Sessions: fix auth scopes of gh FSP

* sessions customizations: make it easier to scan mcp/plugin marketplac… (#299636)

sessions customizations: make it easier to scan mcp/plugin marketplace list

* sessions: add built-in prompt files with override support (#299629)

* sessions: add built-in prompt files with override support

Ship bundled .prompt.md files with the Sessions app that appear as
slash commands out of the box. Built-in prompts use a BUILTIN_STORAGE
constant (cast as PromptsStorage) defined in the aiCustomization layer,
avoiding changes to the core PromptsStorage enum and prompt service types.

- AgenticPromptsService discovers prompts from vs/sessions/prompts/
  at runtime via FileAccess and injects them into the listing pipeline
- Override logic: user/workspace prompts with matching names take
  precedence over built-in ones
- Built-in prompts open as read-only in the management editor
- Sessions tree view, workspace service, and counts handle BUILTIN_STORAGE
- Add /create-pr as the first built-in prompt
- Bundle prompt files via gulpfile resource includes

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

* Update src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.ts

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

* sessions: use AICustomizationPromptsStorage type for builtin storage

Adopt the new AICustomizationPromptsStorage union type in the sessions
tree view method signature. Use string-keyed Records and targeted casts
at the PromptsStorage boundary to stay type-safe.

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

* sessions: remove PromptsStorage casts, widen IStorageSourceFilter

Use AICustomizationPromptsStorage in sessions-local interfaces
(IAICustomizationGroupItem, IAICustomizationFileItem) and widen
IStorageSourceFilter.sources to readonly string[] so BUILTIN_STORAGE
flows through without casts. The only remaining cast is at the
IPromptPath creation boundary in AgenticPromptsService.

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

* sessions: move BUILTIN_STORAGE to sessions common layer

Move AICustomizationPromptsStorage type and BUILTIN_STORAGE constant
from the workbench browser UI module to sessions/contrib/chat/common
so that AgenticPromptsService (a service) does not depend on UI code.

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

---------

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

* sessions: fix ESLint dangerous type assertion in builtin prompts (#299663)

Replace the `as IPromptPath` cast in discoverBuiltinPrompts with a
createBuiltinPromptPath factory function that contains the type
narrowing in one place, satisfying the code-no-dangerous-type-assertions
ESLint rule.

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

* Enhance Agent Sessions Control and Renderer with observable active session resource

* fix terminal

* Enable model management in NewChatWidget

* review feedback

* different competion settings for copilot markdown and plaintext

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
Co-authored-by: Johannes Rieken <johannes.rieken@gmail.com>
Co-authored-by: BeniBenj <besimmonds@microsoft.com>
Co-authored-by: Osvaldo Ortega <osortega@microsoft.com>
Co-authored-by: Josh Spicer <23246594+joshspicer@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant