mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
fix: address CodeRabbitAI review feedback
- Replace busy-wait loop in refreshModels with Promise-based approach - Remove duplicate error logging in opencode-models.ts handlers - Fix multi-slash parsing in provider-icon.tsx (only handle exactly one slash) - Use dynamic icon resolution for selected OpenCode model in trigger - Fix misleading comment about merge precedence (static takes precedence) - Add enabledOpencodeModels and opencodeDefaultModel to settings sync - Add clarifying comments about session-only dynamic model settings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
DhanushSantosh
parent
20cc401238
commit
edcc4e789b
@@ -584,10 +584,13 @@ export interface AppState {
|
||||
codexEnableImages: boolean; // Enable image processing
|
||||
|
||||
// OpenCode CLI Settings (global)
|
||||
// Static OpenCode settings are persisted via SETTINGS_FIELDS_TO_SYNC
|
||||
enabledOpencodeModels: OpencodeModelId[]; // Which static OpenCode models are available
|
||||
opencodeDefaultModel: OpencodeModelId; // Default OpenCode model selection
|
||||
// Dynamic models are session-only (not persisted) because they're discovered at runtime
|
||||
// from `opencode models` CLI and depend on current provider authentication state
|
||||
dynamicOpencodeModels: ModelDefinition[]; // Dynamically discovered models from OpenCode CLI
|
||||
enabledDynamicModelIds: string[]; // Which dynamic models are enabled (model IDs)
|
||||
enabledDynamicModelIds: string[]; // Which dynamic models are enabled (session-only)
|
||||
cachedOpencodeProviders: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -2036,6 +2039,8 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
|
||||
: state.enabledOpencodeModels.filter((m) => m !== model),
|
||||
})),
|
||||
setDynamicOpencodeModels: (models) => {
|
||||
// Dynamic models are session-only (not persisted to server) because they depend on
|
||||
// current CLI authentication state and are re-discovered each session
|
||||
// When setting dynamic models, auto-enable all of them if enabledDynamicModelIds is empty
|
||||
const currentEnabled = get().enabledDynamicModelIds;
|
||||
const newModelIds = models.map((m) => m.id);
|
||||
|
||||
Reference in New Issue
Block a user