github / github/copilot-cli

Copilot CLI incorrectly switches back to previous model after switching to BYOK

Open
#3,978 1 comment 5 reactions 0 assignees View on GitHub
area:models area:sessions
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the bug

I ran out of AIC while using claude-sonnet-4.6. After exiting GitHub Copilot and resuming my session using BYOK, the Copilot CLI automatically switched back to claude-sonnet-4.6, despite having supposedly switched to the BYOK configuration.

### Affected version

_No response_

### Steps to reproduce the behavior

1. Run out of AIC while using claude-sonnet-4.6.
2. Exit GitHub Copilot.
3. Resume session using BYOK.
4. Observe that Copilot CLI automatically switches back to claude-sonnet-4.6 or showing this:

```
Model 'glm-5.2:cloud' not found on provider at https://ollama.com/v1 (HTTP 404).
Check that the model is available on your provider.
```

Image

### Expected behavior

The CLI should respect the BYOK configuration and not revert to the previously used model after a session restart.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the listed session restart flow: run out of AIC, exit Copilot CLI, and resume with BYOK. Trace how the BYOK configuration and selected model are restored, including the Ollama provider error. Done means a resumed BYOK session keeps its configured model instead of reverting to the previous model.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama, shell
Domain
ai, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.