After the YAML-only config migration (#118) removed the legacy champ.*
VS Code settings from package.json, two webview flows still write them:
- webview-ui/static/main.js:166 (classic 'Save & Reload' settings panel)
- webview-ui/static/main.js:2739 (Add-Model dialogue)
Both post a saveSettings message; the host handler in
src/ui/chat-view-provider.ts:489 calls
vscode.workspace.getConfiguration("champ").update("provider",…) and
champ.<provider>.model. Because champ.provider / champ.<provider>.model
/ champ.<provider>.baseUrl are no longer registered configuration keys,
VS Code throws Unable to write to User Settings because champ.provider is not a registered configuration.
Repro: type anything in the chat box → the settings overlay fires a save →
error surfaces.
Acceptance criteria:
- The
saveSettings handler persists provider/model/baseUrl to
.champ/config.yaml (via upsertProviderInYaml, setActive: true) instead
of VS Code global settings, then triggers champ.reloadProvider.
- No
champ.* VS Code setting write remains in the saveSettings path for
provider, model, or baseUrl.
- Failing test first: a test asserting the save writes the YAML block and
never calls configuration.update for provider/<provider>.model.
- Existing full suite stays green (no regressions live behind the chat box).
Tests required:
After the YAML-only config migration (#118) removed the legacy champ.*
VS Code settings from package.json, two webview flows still write them:
Both post a
saveSettingsmessage; the host handler insrc/ui/chat-view-provider.ts:489 calls
vscode.workspace.getConfiguration("champ").update("provider",…)andchamp.<provider>.model. Becausechamp.provider/champ.<provider>.model/
champ.<provider>.baseUrlare no longer registered configuration keys,VS Code throws
Unable to write to User Settings because champ.provider is not a registered configuration.Repro: type anything in the chat box → the settings overlay fires a save →
error surfaces.
Acceptance criteria:
saveSettingshandler persists provider/model/baseUrl to.champ/config.yaml(via upsertProviderInYaml, setActive: true) insteadof VS Code global settings, then triggers champ.reloadProvider.
champ.*VS Code setting write remains in the saveSettings path forprovider, model, or baseUrl.
never calls configuration.update for
provider/<provider>.model.Tests required:
config.yaml and marks it active