fix: remaining areas where stats got reset
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m3s
CI / Lint & Test (pull_request) Successful in 16m9s
CI / Build Linux (pull_request) Successful in 20m2s
CI / Build Windows (cross-compile) (pull_request) Successful in 29m47s

This commit is contained in:
2026-02-06 11:02:10 -08:00
parent dfb1ab36ce
commit 5d99fed33a
3 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -4,7 +4,7 @@
import { claudeStore } from "$lib/stores/claude"; import { claudeStore } from "$lib/stores/claude";
import { characterState } from "$lib/stores/character"; import { characterState } from "$lib/stores/character";
import type { PermissionRequest } from "$lib/types/messages"; import type { PermissionRequest } from "$lib/types/messages";
import { updateDiscordRpc } from "$lib/tauri"; import { updateDiscordRpc, setSkipNextGreeting } from "$lib/tauri";
import { conversationsStore } from "$lib/stores/conversations"; import { conversationsStore } from "$lib/stores/conversations";
import { configStore } from "$lib/stores/config"; import { configStore } from "$lib/stores/config";
@@ -49,6 +49,9 @@
throw new Error("No active conversation"); throw new Error("No active conversation");
} }
// Prevent stats reset on reconnection
setSkipNextGreeting(true);
await invoke("stop_claude", { conversationId }); await invoke("stop_claude", { conversationId });
// Small delay to ensure clean shutdown // Small delay to ensure clean shutdown
+4 -1
View File
@@ -30,7 +30,7 @@
createSummary, createSummary,
sanitizeForJson, sanitizeForJson,
} from "$lib/utils/conversationUtils"; } from "$lib/utils/conversationUtils";
import { updateDiscordRpc } from "$lib/tauri"; import { updateDiscordRpc, setSkipNextGreeting } from "$lib/tauri";
const DISCORD_URL = "https://chat.nhcarrigan.com"; const DISCORD_URL = "https://chat.nhcarrigan.com";
const DONATE_URL = "https://donate.nhcarrigan.com"; const DONATE_URL = "https://donate.nhcarrigan.com";
@@ -251,6 +251,9 @@
: sanitizedContent; : sanitizedContent;
// Step 1: Disconnect from Claude to reset context // Step 1: Disconnect from Claude to reset context
// Prevent stats reset on reconnection
setSkipNextGreeting(true);
if (connectionStatus === "connected") { if (connectionStatus === "connected") {
await invoke("stop_claude", { conversationId: activeId }); await invoke("stop_claude", { conversationId: activeId });
} }
+4 -1
View File
@@ -5,7 +5,7 @@
import { claudeStore, hasQuestionPending } from "$lib/stores/claude"; import { claudeStore, hasQuestionPending } from "$lib/stores/claude";
import { characterState } from "$lib/stores/character"; import { characterState } from "$lib/stores/character";
import type { UserQuestionEvent } from "$lib/types/messages"; import type { UserQuestionEvent } from "$lib/types/messages";
import { updateDiscordRpc } from "$lib/tauri"; import { updateDiscordRpc, setSkipNextGreeting } from "$lib/tauri";
import { conversationsStore } from "$lib/stores/conversations"; import { conversationsStore } from "$lib/stores/conversations";
import { configStore } from "$lib/stores/config"; import { configStore } from "$lib/stores/config";
@@ -89,6 +89,9 @@
claudeStore.clearQuestion(); claudeStore.clearQuestion();
try { try {
// Prevent stats reset on reconnection
setSkipNextGreeting(true);
await invoke("stop_claude", { conversationId }); await invoke("stop_claude", { conversationId });
await new Promise((resolve) => setTimeout(resolve, 500)); await new Promise((resolve) => setTimeout(resolve, 500));