github / github/copilot-cli

`model` field in `settings.json` is not applied on startup; sessions fall back to default `claude-sonnet-5`

未關閉
#4,067 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:configuration area:models
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

## Describe the bug
When `~/.copilot/settings.json` contains a valid, account-enabled top-level `"model"` value, the CLI does not apply it at startup. Sessions resolve to the built-in default `claude-sonnet-5` instead. This is the same top-level `model` key that the in-app `/model` picker writes (verified by format, plain model id), so it would be expected to load on startup.

This differs from #3481 and closed #3557, which concern `contextTier` not being restored. Notably, #3557's description asserts "the `model` field is loaded correctly" — on 1.0.69 that is not the case. I have not determined when this broke, so I'm not claiming a regression, only current behavior.

## Affected version
1.0.69 (macOS, Darwin arm64)

## Steps to reproduce the behavior
1. Edit `~/.copilot/settings.json` to include `"model": "claude-opus-4.8"` (matches the format the `/model` picker writes; I hand-edited it — I did not separately test the picker-save-then-restart path).
2. From a clean shell, run `copilot` (bare, no flags). Also reproduces with `-p` and `-i`.
3. Observe the resolved model via the log line `Using default model: claude-sonnet-5`, or `assistant_usage_events` in `~/.copilot/session-store.db`.

## Expected behavior
Session starts on `claude-opus-4.8`.

Actual: session starts on `claude-sonnet-5`.

## Additional context
- `copilot --model claude-opus-4.8` and `COPILOT_MODEL=claude-opus-4.8 copilot` both correctly run Opus, so the model is enabled/available on the account; only the `settings.json` path is skipped.
- Not a write race: `settings.json` md5/mtime are unchanged across launches.
- Reproduced under a fully sanitized environment (`env -i`), and in both interactive and `-p` modes.
- Inferred (from decompiled `app.js`, not confirmed at runtime): the resolver considers `--model` > session model > `COPILOT_MODEL` > `settings.json` model > default, and the config tier appears skipped, landing on the default `claude-sonnet-5`. Treat this as a hypothesis, not a verified execution path.

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing the startup path with ~/.copilot/settings.json and inspect the model-resolution logic in the decompiled app.js. Compare a configured model with the --model and COPILOT_MODEL cases, then verify that startup logs and session-store.db show the configured model instead of claude-sonnet-5.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
shell
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
64/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。