generated from nhcarrigan/template
feat: expose modelOverrides setting in ConfigSidebar
This commit is contained in:
@@ -68,6 +68,7 @@ vi.mock("$lib/stores/config", () => ({
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
}),
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -69,6 +69,7 @@ async function changeDirectory(path: string): Promise<void> {
|
||||
include_git_instructions: config.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: config.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: config.auto_memory_directory || null,
|
||||
model_overrides: config.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -149,6 +150,7 @@ async function startNewConversation(): Promise<void> {
|
||||
include_git_instructions: config.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: config.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: config.auto_memory_directory || null,
|
||||
model_overrides: config.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
max_output_tokens: null,
|
||||
trusted_workspaces: [],
|
||||
background_image_path: null,
|
||||
@@ -82,6 +83,8 @@
|
||||
let customUiFontPathInput = $state("");
|
||||
let customUiFontFamilyInput = $state("");
|
||||
let customUiFontStatus: string | null = $state(null);
|
||||
let modelOverridesJson = $state("");
|
||||
let modelOverridesError: string | null = $state(null);
|
||||
|
||||
interface AuthStatus {
|
||||
is_logged_in: boolean;
|
||||
@@ -111,6 +114,7 @@
|
||||
customFontFamilyInput = c.custom_font_family ?? "";
|
||||
customUiFontPathInput = c.custom_ui_font_path ?? "";
|
||||
customUiFontFamilyInput = c.custom_ui_font_family ?? "";
|
||||
modelOverridesJson = c.model_overrides ? JSON.stringify(c.model_overrides, null, 2) : "";
|
||||
});
|
||||
|
||||
configStore.isSidebarOpen.subscribe((open) => {
|
||||
@@ -196,6 +200,18 @@
|
||||
async function handleSave() {
|
||||
isSaving = true;
|
||||
saveError = null;
|
||||
modelOverridesError = null;
|
||||
try {
|
||||
if (modelOverridesJson.trim()) {
|
||||
config.model_overrides = JSON.parse(modelOverridesJson) as Record<string, string>;
|
||||
} else {
|
||||
config.model_overrides = null;
|
||||
}
|
||||
} catch {
|
||||
modelOverridesError = "Invalid JSON — please check your model overrides.";
|
||||
isSaving = false;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await configStore.saveConfig(config);
|
||||
configStore.closeSidebar();
|
||||
@@ -622,6 +638,28 @@
|
||||
default (working directory).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Model Overrides -->
|
||||
<div class="mb-4">
|
||||
<label for="model-overrides" class="block text-sm text-[var(--text-primary)] mb-1">
|
||||
Model overrides <span class="text-[var(--text-tertiary)]">(optional)</span>
|
||||
</label>
|
||||
<textarea
|
||||
id="model-overrides"
|
||||
rows={4}
|
||||
placeholder={'{\n "claude-opus-4-6": "arn:aws:bedrock:..."\n}'}
|
||||
bind:value={modelOverridesJson}
|
||||
class="w-full px-3 py-2 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded text-[var(--text-primary)] placeholder-[var(--text-tertiary)] focus:outline-none focus:border-[var(--accent-primary)] font-mono resize-y"
|
||||
></textarea>
|
||||
{#if modelOverridesError}
|
||||
<p class="text-xs text-red-500 mt-1">{modelOverridesError}</p>
|
||||
{/if}
|
||||
<p class="text-xs text-[var(--text-tertiary)] mt-1">
|
||||
JSON map of model names to provider-specific IDs (for AWS Bedrock, Google Vertex, etc.).
|
||||
Passed via <code class="font-mono">--settings modelOverrides</code>. Leave blank to use
|
||||
defaults.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Greeting Section -->
|
||||
|
||||
@@ -405,6 +405,7 @@ User: ${formattedMessage}`;
|
||||
include_git_instructions: config.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: config.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: config.auto_memory_directory || null,
|
||||
model_overrides: config.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
include_git_instructions: config.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: config.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: config.auto_memory_directory || null,
|
||||
model_overrides: config.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
});
|
||||
|
||||
let streamerModeActive = $state(false);
|
||||
@@ -175,6 +176,7 @@
|
||||
include_git_instructions: currentConfig.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: currentConfig.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: currentConfig.auto_memory_directory || null,
|
||||
model_overrides: currentConfig.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -335,6 +337,7 @@
|
||||
include_git_instructions: currentConfig.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: currentConfig.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: currentConfig.auto_memory_directory || null,
|
||||
model_overrides: currentConfig.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
include_git_instructions: cfg.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: cfg.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: cfg.auto_memory_directory || null,
|
||||
model_overrides: cfg.model_overrides || null,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -111,6 +111,7 @@
|
||||
include_git_instructions: config.include_git_instructions ?? true,
|
||||
enable_claudeai_mcp_servers: config.enable_claudeai_mcp_servers ?? true,
|
||||
auto_memory_directory: config.auto_memory_directory || null,
|
||||
model_overrides: config.model_overrides || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -224,6 +224,7 @@ describe("config store", () => {
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
};
|
||||
|
||||
expect(config.model).toBe("claude-sonnet-4");
|
||||
@@ -287,6 +288,7 @@ describe("config store", () => {
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
};
|
||||
|
||||
expect(config.model).toBeNull();
|
||||
@@ -905,6 +907,7 @@ describe("config store", () => {
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
};
|
||||
|
||||
const mockInvokeImpl = vi.mocked(invoke);
|
||||
|
||||
@@ -89,6 +89,8 @@ export interface HikariConfig {
|
||||
enable_claudeai_mcp_servers: boolean;
|
||||
// Auto-memory directory
|
||||
auto_memory_directory: string | null;
|
||||
// Model overrides for provider-specific model IDs (AWS Bedrock, Google Vertex, etc.)
|
||||
model_overrides: Record<string, string> | null;
|
||||
}
|
||||
|
||||
const defaultConfig: HikariConfig = {
|
||||
@@ -146,6 +148,7 @@ const defaultConfig: HikariConfig = {
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
auto_memory_directory: null,
|
||||
model_overrides: null,
|
||||
};
|
||||
|
||||
function createConfigStore() {
|
||||
|
||||
Reference in New Issue
Block a user