sessions: fix ESLint dangerous type assertion in builtin prompts#299663
Merged
joshspicer merged 1 commit intosandy081/layout-explorationfrom Mar 6, 2026
Merged
sessions: fix ESLint dangerous type assertion in builtin prompts#299663joshspicer merged 1 commit intosandy081/layout-explorationfrom
joshspicer merged 1 commit intosandy081/layout-explorationfrom
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the
as IPromptPathcast in discoverBuiltinPrompts with a createBuiltinPromptPath factory function that contains the type narrowing in one place, satisfying the code-no-dangerous-type-assertions ESLint rule.