Skip to content

don't block chat when collecting instructions fail#306161

Merged
aeschli merged 1 commit intomainfrom
aeschli/querulous-meerkat-698
Mar 29, 2026
Merged

don't block chat when collecting instructions fail#306161
aeschli merged 1 commit intomainfrom
aeschli/querulous-meerkat-698

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Mar 29, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 29, 2026 21:01
@aeschli aeschli enabled auto-merge (squash) March 29, 2026 21:01
@aeschli aeschli self-assigned this Mar 29, 2026
@vs-code-engineering vs-code-engineering bot added this to the Backlog milestone Mar 29, 2026
Copy link
Copy Markdown
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

This PR makes chat input submission resilient to failures during automatic instruction collection, so users can continue chatting even if prompt/instruction discovery or parsing encounters errors.

Changes:

  • Wrap automatic instruction computation/collection in a try/catch to prevent errors from aborting chat submission.
  • Log failures from automatic instruction computation instead of propagating them.

const computer = this.instantiationService.createInstance(ComputeAutomaticInstructions, this.input.currentModeKind, enabledTools, enabledSubAgents, sessionResource);
await computer.collect(attachedContext, CancellationToken.None);
} catch (err) {
this.logService.error(`ChatWidget#_autoAttachInstructions: failed to compute automatic instructions`, err);
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

This catch makes instruction collection best-effort (non-fatal), but it logs at error level on every send attempt when failures persist (e.g. file locator/read issues). Consider downgrading this to warn (similar to _checkForAgentInstructionFiles earlier in this file) and/or rate-limit/log-once per widget/session to avoid noisy logs while still capturing the failure context.

Suggested change
this.logService.error(`ChatWidget#_autoAttachInstructions: failed to compute automatic instructions`, err);
this.logService.warn(`ChatWidget#_autoAttachInstructions: failed to compute automatic instructions`, err);

Copilot uses AI. Check for mistakes.
@aeschli aeschli merged commit d7ebb2c into main Mar 29, 2026
31 of 33 checks passed
@aeschli aeschli deleted the aeschli/querulous-meerkat-698 branch March 29, 2026 21:47
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.

3 participants