Skip to content

Fix auto mode fallback for empty model providers#316174

Merged
bhavyaus merged 3 commits into
microsoft:mainfrom
sgoedecke:sgoedecke/chamomile-auto-mode
Jun 4, 2026
Merged

Fix auto mode fallback for empty model providers#316174
bhavyaus merged 3 commits into
microsoft:mainfrom
sgoedecke:sgoedecke/chamomile-auto-mode

Conversation

@sgoedecke

Copy link
Copy Markdown
Contributor

Summary

  • Treat an empty current model provider as no provider affinity in Auto Mode default selection
  • Add a regression test for an empty-provider model remaining selectable across turns

Validation

  • PATH="$PWD/node_modules/.bin:$PATH" npm --prefix extensions/copilot run typecheck
  • PATH="$PWD/node_modules/.bin:$PATH" npm --prefix extensions/copilot run test:unit -- src/platform/endpoint/node/test/automodeService.spec.ts
  • node --experimental-strip-types build/hygiene.ts extensions/copilot/src/platform/endpoint/node/automodeService.ts extensions/copilot/src/platform/endpoint/node/test/automodeService.spec.ts
  • npm run precommit

Treat an empty current model provider as no provider affinity so Auto Mode still falls back to the first available model with a known endpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 13, 2026 03:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes Auto Mode’s default model selection when the previously selected endpoint has an empty modelProvider, ensuring that an empty provider is treated as “no provider affinity” (so selection correctly falls back to the first available model instead of mistakenly short-circuiting).

Changes:

  • Fix _selectDefaultModel to avoid && producing an empty-string value that blocks the ?? fallback.
  • Add a regression test ensuring an empty-provider model remains selectable across subsequent turns.
Show a summary per file
File Description
extensions/copilot/src/platform/endpoint/node/automodeService.ts Fix default model selection to treat empty currentModelProvider as no affinity so the first available model is chosen correctly.
extensions/copilot/src/platform/endpoint/node/test/automodeService.spec.ts Add a regression test covering repeated turns when the current endpoint’s modelProvider is empty.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@deepak1556 deepak1556 assigned bhavyaus and unassigned deepak1556 May 13, 2026
@bhavyaus bhavyaus enabled auto-merge (squash) May 15, 2026 04:15
@bhavyaus bhavyaus merged commit 4e9a386 into microsoft:main Jun 4, 2026
39 of 40 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants