generated from nhcarrigan/template
feat: Claude Code CLI v2.1.105–v2.1.131 support (#274)
## Overview Full audit and implementation of Claude Code CLI changelog entries from v2.1.105 through v2.1.131. ## Changes ### Implemented - **#268** — Add `claude-opus-4-7` to the model picker, update all model pricing and context window sizes (also fixes a bug where `claude-opus-4-6` was coded as 200K context instead of 1M) - **#269** — Expose effort level setting in UI via `--effort <level>` flag (`low`, `medium`, `high`, `xhigh`, `max`) - **#273** — Expose prompt caching TTL env vars in UI (`ENABLE_PROMPT_CACHING_1H` / `FORCE_PROMPT_CACHING_5M`) - **#267** — Add `PreCompact` hook support — emits `claude:pre-compact` event with "Compacting context..." toast and thinking state - **#270** — Parse `plugin_errors` from stream-json init event and surface them as error output lines - **#266** — Bump supported CLI version constant to `2.1.131` ### Closed as Not Applicable - **#271** (`autoScrollEnabled`) — TUI-only setting; we manage our own scroll behaviour - **#272** (`tui` fullscreen mode) — TUI-only setting; we use stream-json and never activate the TUI ## Testing All checks pass (`./check-all.sh`) including frontend lint, format, type check, Vitest coverage, Clippy, and Rust test coverage. ✨ This PR was created with help from Hikari~ 🌸 Reviewed-on: #274 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #274.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
const SUPPORTED_CLI_VERSION = "2.1.104";
|
||||
const SUPPORTED_CLI_VERSION = "2.1.131";
|
||||
|
||||
let installedVersion = $state("Loading...");
|
||||
let latestNpmVersion = $state<string | null>(null);
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
task_loop_auto_commit: false,
|
||||
task_loop_commit_prefix: "feat",
|
||||
task_loop_include_summary: false,
|
||||
effort_level: null,
|
||||
prompt_caching_ttl: null,
|
||||
});
|
||||
|
||||
let showCustomThemeEditor = $state(false);
|
||||
@@ -144,17 +146,20 @@
|
||||
|
||||
const availableModels = [
|
||||
{ value: "", label: "Default (from ~/.claude)" },
|
||||
// Current generation (Claude 4.6)
|
||||
{ value: "claude-opus-4-6", label: "Claude Opus 4.6 (Most Capable)" },
|
||||
// Current generation (Claude 4.7/4.6/4.5)
|
||||
{ value: "claude-opus-4-7", label: "Claude Opus 4.7 (Most Capable)" },
|
||||
{ value: "claude-sonnet-4-6", label: "Claude Sonnet 4.6 (Recommended)" },
|
||||
{ value: "claude-haiku-4-5-20251001", label: "Claude Haiku 4.5 (Fast & Cheap)" },
|
||||
// Previous generation (Claude 4.6)
|
||||
{ value: "claude-opus-4-6", label: "Claude Opus 4.6" },
|
||||
// Previous generation (Claude 4.5)
|
||||
{ value: "claude-sonnet-4-5-20250929", label: "Claude Sonnet 4.5" },
|
||||
{ value: "claude-haiku-4-5-20251001", label: "Claude Haiku 4.5 (Fast & Cheap)" },
|
||||
{ value: "claude-opus-4-5-20251101", label: "Claude Opus 4.5" },
|
||||
// Previous generation (Claude 4.x)
|
||||
{ value: "claude-opus-4-1-20250805", label: "Claude Opus 4.1" },
|
||||
{ value: "claude-sonnet-4-20250514", label: "Claude Sonnet 4" },
|
||||
{ value: "claude-opus-4-20250514", label: "Claude Opus 4" },
|
||||
// Deprecated — retire June 15, 2026
|
||||
{ value: "claude-sonnet-4-20250514", label: "Claude Sonnet 4 (Deprecated)" },
|
||||
{ value: "claude-opus-4-20250514", label: "Claude Opus 4 (Deprecated)" },
|
||||
];
|
||||
|
||||
const commonTools = [
|
||||
@@ -713,6 +718,49 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Effort Level -->
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm text-[var(--text-primary)] mb-1" for="effort-level"
|
||||
>Effort level</label
|
||||
>
|
||||
<select
|
||||
id="effort-level"
|
||||
bind:value={config.effort_level}
|
||||
class="w-full px-3 py-2 rounded border border-[var(--border-color)] bg-[var(--bg-primary)] text-[var(--text-primary)] text-sm focus:outline-none focus:ring-1 focus:ring-[var(--accent-primary)]"
|
||||
>
|
||||
<option value={null}>Default (CLI decides)</option>
|
||||
<option value="low">Low</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="high">High</option>
|
||||
<option value="xhigh">Extra High (Opus 4.7 only)</option>
|
||||
<option value="max">Max</option>
|
||||
</select>
|
||||
<p class="text-xs text-[var(--text-tertiary)] mt-1">
|
||||
Passes <code class="font-mono">--effort</code> to tune speed vs. intelligence. Requires Claude
|
||||
Code v2.1.111+.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Prompt Caching TTL -->
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm text-[var(--text-primary)] mb-1" for="prompt-caching-ttl"
|
||||
>Prompt caching TTL</label
|
||||
>
|
||||
<select
|
||||
id="prompt-caching-ttl"
|
||||
bind:value={config.prompt_caching_ttl}
|
||||
class="w-full px-3 py-2 rounded border border-[var(--border-color)] bg-[var(--bg-primary)] text-[var(--text-primary)] text-sm focus:outline-none focus:ring-1 focus:ring-[var(--accent-primary)]"
|
||||
>
|
||||
<option value={null}>Default (CLI decides)</option>
|
||||
<option value="1h">1-hour TTL (reduces cost for long sessions)</option>
|
||||
<option value="5m">Force 5-minute TTL</option>
|
||||
</select>
|
||||
<p class="text-xs text-[var(--text-tertiary)] mt-1">
|
||||
Sets <code class="font-mono">ENABLE_PROMPT_CACHING_1H</code> or
|
||||
<code class="font-mono">FORCE_PROMPT_CACHING_5M</code>. Requires Claude Code v2.1.108+.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Bare Mode -->
|
||||
<div class="mb-4">
|
||||
<label class="flex items-center gap-3 cursor-pointer">
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
bare_mode: config.bare_mode ?? false,
|
||||
show_clear_context_on_plan_accept: config.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: config.custom_model_option || null,
|
||||
effort_level: config.effort_level || null,
|
||||
prompt_caching_ttl: config.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -412,6 +412,8 @@ User: ${formattedMessage}`;
|
||||
bare_mode: config.bare_mode ?? false,
|
||||
show_clear_context_on_plan_accept: config.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: config.custom_model_option || null,
|
||||
effort_level: config.effort_level || null,
|
||||
prompt_caching_ttl: config.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@
|
||||
bare_mode: config.bare_mode ?? false,
|
||||
show_clear_context_on_plan_accept: config.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: config.custom_model_option || null,
|
||||
effort_level: config.effort_level || null,
|
||||
prompt_caching_ttl: config.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -97,6 +97,8 @@
|
||||
bare_mode: false,
|
||||
show_clear_context_on_plan_accept: true,
|
||||
custom_model_option: null,
|
||||
effort_level: null,
|
||||
prompt_caching_ttl: null,
|
||||
});
|
||||
|
||||
let streamerModeActive = $state(false);
|
||||
@@ -189,6 +191,8 @@
|
||||
show_clear_context_on_plan_accept:
|
||||
currentConfig.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: currentConfig.custom_model_option || null,
|
||||
effort_level: currentConfig.effort_level || null,
|
||||
prompt_caching_ttl: currentConfig.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -357,6 +361,8 @@
|
||||
show_clear_context_on_plan_accept:
|
||||
currentConfig.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: currentConfig.custom_model_option || null,
|
||||
effort_level: currentConfig.effort_level || null,
|
||||
prompt_caching_ttl: currentConfig.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -228,6 +228,8 @@
|
||||
bare_mode: cfg.bare_mode ?? false,
|
||||
show_clear_context_on_plan_accept: cfg.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: cfg.custom_model_option || null,
|
||||
effort_level: cfg.effort_level || null,
|
||||
prompt_caching_ttl: cfg.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -118,6 +118,8 @@
|
||||
bare_mode: config.bare_mode ?? false,
|
||||
show_clear_context_on_plan_accept: config.show_clear_context_on_plan_accept ?? true,
|
||||
custom_model_option: config.custom_model_option || null,
|
||||
effort_level: config.effort_level || null,
|
||||
prompt_caching_ttl: config.prompt_caching_ttl || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user