Skip to content

Bug fix: Fix skill load regression #303277

Merged
vijayupadya merged 2 commits intomainfrom
vijayu/loadFix
Mar 19, 2026
Merged

Bug fix: Fix skill load regression #303277
vijayupadya merged 2 commits intomainfrom
vijayu/loadFix

Conversation

@vijayupadya
Copy link
Contributor

@vijayupadya vijayupadya commented Mar 19, 2026

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.

@vijayupadya vijayupadya requested review from Copilot and removed request for Copilot March 19, 2026 18:02
pwang347
pwang347 previously approved these changes Mar 19, 2026
@vijayupadya vijayupadya marked this pull request as ready for review March 19, 2026 18:16
Copilot AI review requested due to automatic review settings March 19, 2026 18:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _autoAttachInstructions to treat autoAttachReferences: false as the only skip condition (instead of treating undefined as 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 chatSessions contribution should still run automatic instruction/skill loading; only an explicit autoAttachReferences: false should skip). There are already unit tests for ComputeAutomaticInstructions, 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`);

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. this should be opt-in.

@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 19, 2026
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.

4 participants