mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 11:03:07 +00:00
Merge pull request #331 from mrexodia/enabled-models
Add `enabledModels` to `settings.json`
This commit is contained in:
commit
9b1e00a814
4 changed files with 14 additions and 2 deletions
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **`enabledModels` setting**: Configure whitelisted models in `settings.json` (same format as `--models` CLI flag). CLI `--models` takes precedence over the setting.
|
||||||
|
|
||||||
## [0.30.2] - 2025-12-26
|
## [0.30.2] - 2025-12-26
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -699,6 +699,7 @@ Global `~/.pi/agent/settings.json` stores persistent preferences:
|
||||||
"defaultProvider": "anthropic",
|
"defaultProvider": "anthropic",
|
||||||
"defaultModel": "claude-sonnet-4-20250514",
|
"defaultModel": "claude-sonnet-4-20250514",
|
||||||
"defaultThinkingLevel": "medium",
|
"defaultThinkingLevel": "medium",
|
||||||
|
"enabledModels": ["claude-sonnet", "gpt-4o", "gemini-2.5-pro:high"],
|
||||||
"queueMode": "one-at-a-time",
|
"queueMode": "one-at-a-time",
|
||||||
"shellPath": "C:\\path\\to\\bash.exe",
|
"shellPath": "C:\\path\\to\\bash.exe",
|
||||||
"hideThinkingBlock": false,
|
"hideThinkingBlock": false,
|
||||||
|
|
@ -731,6 +732,7 @@ Global `~/.pi/agent/settings.json` stores persistent preferences:
|
||||||
| `defaultProvider` | Default model provider | - |
|
| `defaultProvider` | Default model provider | - |
|
||||||
| `defaultModel` | Default model ID | - |
|
| `defaultModel` | Default model ID | - |
|
||||||
| `defaultThinkingLevel` | Thinking level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` | - |
|
| `defaultThinkingLevel` | Thinking level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` | - |
|
||||||
|
| `enabledModels` | Model patterns for cycling (same as `--models` CLI flag) | - |
|
||||||
| `queueMode` | Message queue mode: `all` or `one-at-a-time` | `one-at-a-time` |
|
| `queueMode` | Message queue mode: `all` or `one-at-a-time` | `one-at-a-time` |
|
||||||
| `shellPath` | Custom bash path (Windows) | auto-detected |
|
| `shellPath` | Custom bash path (Windows) | auto-detected |
|
||||||
| `hideThinkingBlock` | Hide thinking blocks in output (Ctrl+T to toggle) | `false` |
|
| `hideThinkingBlock` | Hide thinking blocks in output (Ctrl+T to toggle) | `false` |
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ export interface Settings {
|
||||||
customTools?: string[]; // Array of custom tool file paths
|
customTools?: string[]; // Array of custom tool file paths
|
||||||
skills?: SkillsSettings;
|
skills?: SkillsSettings;
|
||||||
terminal?: TerminalSettings;
|
terminal?: TerminalSettings;
|
||||||
|
enabledModels?: string[]; // Model patterns for cycling (same format as --models CLI flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */
|
/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */
|
||||||
|
|
@ -365,4 +366,8 @@ export class SettingsManager {
|
||||||
this.globalSettings.terminal.showImages = show;
|
this.globalSettings.terminal.showImages = show;
|
||||||
this.save();
|
this.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getEnabledModels(): string[] | undefined {
|
||||||
|
return this.settings.enabledModels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -341,8 +341,9 @@ export async function main(args: string[]) {
|
||||||
time("initTheme");
|
time("initTheme");
|
||||||
|
|
||||||
let scopedModels: ScopedModel[] = [];
|
let scopedModels: ScopedModel[] = [];
|
||||||
if (parsed.models && parsed.models.length > 0) {
|
const modelPatterns = parsed.models ?? settingsManager.getEnabledModels();
|
||||||
scopedModels = await resolveModelScope(parsed.models, modelRegistry);
|
if (modelPatterns && modelPatterns.length > 0) {
|
||||||
|
scopedModels = await resolveModelScope(modelPatterns, modelRegistry);
|
||||||
time("resolveModelScope");
|
time("resolveModelScope");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue