mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
Update chat instructions with detailed AI feature gating rules
Co-authored-by: hediet <2931520+hediet@users.noreply.github.com>
This commit is contained in:
committed by
Henning Dieterichs
parent
8d86613bbf
commit
d3e6f4a526
13
.github/instructions/chat.instructions.md
vendored
13
.github/instructions/chat.instructions.md
vendored
@@ -6,3 +6,16 @@ description: Chat feature area coding guidelines
|
||||
|
||||
- When adding a new chat/AI feature like a new surface where chat or agents appear, a new AI command, etc, these features must not show up for users when they've disabled AI features. The best way to do this is to gate the feature on the context key `ChatContextKeys.enabled` via a when clause.
|
||||
- When doing a code review for code that adds an AI feature, please ensure that the feature is properly gated.
|
||||
|
||||
### Hiding AI Features When Disabled
|
||||
|
||||
When surfacing a UI AI feature, ensure the feature hides when `chat.disableAIFeatures` is set:
|
||||
|
||||
- **UI Hiding**: Use `ChatContextKeys.enabled` in `when` conditions to conditionally show/hide UI elements (commands, views, menu items, etc.)
|
||||
- Example: `when: ChatContextKeys.enabled` in action/command registration
|
||||
- This context key is `false` when AI features are disabled
|
||||
- **Programmatic Hiding**: Check `IChatEntitlementService.sentiment.hidden` to determine if AI features should be hidden
|
||||
- `sentiment.hidden` is `true` when the user signals no intent in using Chat
|
||||
- This should not only disable Chat but also hide all of its UI
|
||||
|
||||
This ensures consistency when implementing AI-powered UI functionality across the codebase.
|
||||
|
||||
Reference in New Issue
Block a user