generated from nhcarrigan/template
feat: expose modelOverrides setting in ConfigSidebar
This commit is contained in:
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user