feat: add mode-specific provider and model configuration#640
feat: add mode-specific provider and model configuration#640akramcodez wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds mode-specific provider/model selection via a new modeProviders config, allowing Nanocoder to automatically switch providers/models when entering specific development modes while preserving the user’s default provider/model when leaving those modes.
Changes:
- Introduces
modeProvidersconfig typing and integrates it intoAppConfig. - Loads and validates
modeProvidersentries during config load (provider/model existence). - Switches provider/model on mode toggle and at startup, while avoiding preference writes for programmatic switches; adds/updates tests around this behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| source/types/config.ts | Adds ModeProviderConfig and modeProviders to the app configuration type. |
| source/config/index.ts | Implements modeProviders config loading/validation and includes it in loadAppConfig(). |
| source/hooks/useAppInitialization.tsx | Applies mode-specific provider/model selection during initialization and supports programmatic switching. |
| source/hooks/useModeHandlers.tsx | Adds a programmatic flag to suppress preference updates and success messages during automatic switches. |
| source/hooks/useAppHandlers.tsx | Switches provider/model when toggling modes and restores defaults when no mode-specific config exists. |
| source/hooks/useAppHandlers.spec.tsx | Updates handler surface/tests to account for mode toggle behavior and model switching. |
| source/config/index.spec.ts | Adds coverage for modeProviders config parsing/validation scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @akramcodez - Thanks for this- the config layer is the strong part. Blockers
Smaller items
Once the wizard question is settled, the perf guard is in, the spec formatting is reverted, and the test hits the real branch, this should be good to go. Also, are you able to address the co-pilot review as well? :) Thanks! |
|
Hey @akramcodez! Thanks for the thorough turnaround. I re-ran the checks locally, and most of the blockers are resolved. One thing remain - the Still a blocker: per-mode
Once the spec formatting is reverted and |
6dd9d3a to
59f02b4
Compare
Closes #277
Description
This PR adds support for mode-specific provider and model configuration via a new
modeProvidersconfiguration inagents.config.json.Previously, Nanocoder used a single global provider/model across all development modes (
normal,plan,yolo,auto-accept,headless). With this change, users can configure different providers and models for individual modes, allowing workflows such as using a powerful cloud model for planning while using a fast local model for implementation.Highlights
modeProvidersconfiguration schema.Type of Change
Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist
CONTRIBUTING.md#logging)