generated from nhcarrigan/template
chore: CLI v2.1.75–v2.1.80 audit and support (#223–#232) (#233)
## Summary This PR implements all tickets filed from the CLI v2.1.74 → v2.1.80 changelog audit (issues #223–#232). ### Changes by Issue - **#223** — `feat: handle Elicitation and ElicitationResult hook events` New `ElicitationModal.svelte` component, Rust parsing for `[Elicitation Hook]` and `[ElicitationResult Hook]`, new store methods, and TypeScript event types. - **#224** — `feat: handle StopFailure hook event for API error turns` Rust parsing for `[StopFailure Hook]`; frontend shows error toast + error character state. - **#225** — `feat: handle PostCompact hook event` Rust parsing for `[PostCompact Hook]`; frontend shows info toast + success character state. - **#226** — `feat: expose --name CLI flag as session name at startup` Added `session_name` field to `ClaudeStartOptions`; `StatusBar.doConnect()` passes the conversation name. - **#227** — `fix: tighten startup watchdog and correct misleading comment` Startup watchdog tightened from 60 s → 30 s; corrected a comment that said "5 minutes" whilst the code used 60 seconds. - **#228** — `fix: document cost estimation review and update default model fallback` Default model fallback updated from `claude-sonnet-4-5-20250929` → `claude-sonnet-4-6`; added doc comment explaining why char-based estimation is unaffected by v2.1.75 token overcounting fix. - **#229** — `chore: update supported CLI version constant to 2.1.80` `SUPPORTED_CLI_VERSION` bumped in `CliVersion.svelte`. - **#230** — `feat: surface memory file last-modified timestamps in MemoryBrowserPanel` Backend populates `last_modified` Unix timestamp; frontend formats and displays it per file. - **#231** — `feat: update max_output_tokens upper bound and helper text for 128k` Input max raised to 128 000; placeholder and helper text updated to reflect model-dependent defaults and 128 k ceiling for Opus/Sonnet 4.6. - **#232** — `fix: document non-streaming fallback compatibility with mid-session watchdog` Added doc comment above `STUCK_TIMEOUT` explaining the 5-minute watchdog is intentionally larger than the CLI's 2-minute non-streaming API fallback. --- ✨ This PR was created with help from Hikari~ 🌸 Reviewed-on: #233 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #233.
This commit is contained in:
+57
-2
@@ -8,7 +8,10 @@ import { initStatsListener, resetSessionStats } from "$lib/stores/stats";
|
||||
import { initAchievementsListener } from "$lib/stores/achievements";
|
||||
import type {
|
||||
ConnectionStatus,
|
||||
ElicitationEvent,
|
||||
PermissionPromptEvent,
|
||||
PostCompactEvent,
|
||||
StopFailureEvent,
|
||||
UserQuestionEvent,
|
||||
} from "$lib/types/messages";
|
||||
import type { CharacterState } from "$lib/types/states";
|
||||
@@ -406,7 +409,8 @@ export async function initializeTauriListeners() {
|
||||
| "rate-limit"
|
||||
| "compact-prompt"
|
||||
| "worktree"
|
||||
| "config-change",
|
||||
| "config-change"
|
||||
| "elicitation",
|
||||
content,
|
||||
tool_name || undefined,
|
||||
costData,
|
||||
@@ -425,7 +429,8 @@ export async function initializeTauriListeners() {
|
||||
| "rate-limit"
|
||||
| "compact-prompt"
|
||||
| "worktree"
|
||||
| "config-change",
|
||||
| "config-change"
|
||||
| "elicitation",
|
||||
content,
|
||||
tool_name || undefined,
|
||||
costData,
|
||||
@@ -611,6 +616,56 @@ export async function initializeTauriListeners() {
|
||||
}
|
||||
});
|
||||
unlisteners.push(questionUnlisten);
|
||||
|
||||
const elicitationUnlisten = await listen<ElicitationEvent>("claude:elicitation", (event) => {
|
||||
const elicitationEvent = event.payload;
|
||||
if (elicitationEvent.conversation_id) {
|
||||
claudeStore.requestElicitationForConversation(
|
||||
elicitationEvent.conversation_id,
|
||||
elicitationEvent
|
||||
);
|
||||
} else {
|
||||
claudeStore.requestElicitation(elicitationEvent);
|
||||
}
|
||||
});
|
||||
unlisteners.push(elicitationUnlisten);
|
||||
|
||||
const elicitationResultUnlisten = await listen<{ conversation_id?: string }>(
|
||||
"claude:elicitation-result",
|
||||
(event) => {
|
||||
const { conversation_id } = event.payload;
|
||||
if (conversation_id) {
|
||||
claudeStore.clearElicitationForConversation(conversation_id);
|
||||
} else {
|
||||
claudeStore.clearElicitation();
|
||||
}
|
||||
}
|
||||
);
|
||||
unlisteners.push(elicitationResultUnlisten);
|
||||
|
||||
const stopFailureUnlisten = await listen<StopFailureEvent>("claude:stop-failure", (event) => {
|
||||
const { stop_reason, error_type } = event.payload;
|
||||
|
||||
characterState.setTemporaryState("error", 3000);
|
||||
|
||||
let message: string;
|
||||
if (stop_reason === "rate_limit") {
|
||||
message = "Rate limit reached";
|
||||
} else if (stop_reason === "auth_failure" || stop_reason === "authentication") {
|
||||
message = "Authentication failed";
|
||||
} else {
|
||||
message = `API error: ${stop_reason ?? error_type ?? "unknown"}`;
|
||||
}
|
||||
|
||||
toastStore.addError(message);
|
||||
});
|
||||
unlisteners.push(stopFailureUnlisten);
|
||||
|
||||
const postCompactUnlisten = await listen<PostCompactEvent>("claude:post-compact", () => {
|
||||
toastStore.addInfo("Context compacted", "🗜️");
|
||||
characterState.setTemporaryState("success", 2000);
|
||||
});
|
||||
unlisteners.push(postCompactUnlisten);
|
||||
}
|
||||
|
||||
export function cleanupTauriListeners() {
|
||||
|
||||
Reference in New Issue
Block a user