Bug fix: Fix skill load regression #303277
Merged
vijayupadya merged 2 commits intomainfrom Mar 19, 2026
Merged
Conversation
pwang347
previously approved these changes
Mar 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the chat widget where automatic instruction/skill loading was being skipped when there was no chatSessions extension point contribution (e.g., default/local chat), by only honoring autoAttachReferences when it is explicitly set to false.
Changes:
- Adjust
_autoAttachInstructionsto treatautoAttachReferences: falseas the only skip condition (instead of treatingundefinedas disabled).
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts:2783
- Consider adding a regression test that exercises this gate (local/default sessions with no
chatSessionscontribution should still run automatic instruction/skill loading; only an explicitautoAttachReferences: falseshould skip). There are already unit tests forComputeAutomaticInstructions, but this bug was in the widget-level condition, so without a widget-level test it’s easy to regress again.
private async _autoAttachInstructions({ attachedContext }: IChatRequestInputOptions): Promise<void> {
const contribution = this._lockedAgent ? this.chatSessionsService.getChatSessionContribution(this._lockedAgent.id) : undefined;
if (contribution?.autoAttachReferences === false) {
this.logService.debug(`ChatWidget#_autoAttachInstructions: skipped, autoAttachReferences is disabled`);
return;
}
this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are always enabled`);
TylerLeonhardt
requested changes
Mar 19, 2026
Member
TylerLeonhardt
left a comment
There was a problem hiding this comment.
No. this should be opt-in.
TylerLeonhardt
approved these changes
Mar 19, 2026
This was referenced Mar 20, 2026
Closed
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.
Fixes a regression introduced in #302508 where _autoAttachInstructions was silently skipped for all chat sessions without an explicit chatSessions extension point contribution (including the default local chat).
The check if (!contribution?.autoAttachReferences) treated undefined (no contribution registered) disabled all instruction, skill, agent, and slash command loading via ComputeAutomaticInstructions.collect(). Only hook loading was unaffected since getHooks() is called independently from chatServiceImpl.ts.