From ce48ac0c34736ef4541a70dff15bb55bbf869170 Mon Sep 17 00:00:00 2001 From: Spicy Marinara Date: Thu, 26 Feb 2026 01:48:15 +0100 Subject: [PATCH] Update src/systems/integration/sillytavern.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/systems/integration/sillytavern.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/systems/integration/sillytavern.js b/src/systems/integration/sillytavern.js index 505c1d9..699e276 100644 --- a/src/systems/integration/sillytavern.js +++ b/src/systems/integration/sillytavern.js @@ -114,7 +114,14 @@ export function commitTrackerData() { // console.log('[RPG Companion] Committing tracker data from assistant message at index', i, 'swipe', swipeId); committedTrackerData.userStats = swipeData.userStats || null; committedTrackerData.infoBox = swipeData.infoBox || null; - committedTrackerData.characterThoughts = swipeData.characterThoughts || null; + const rawCharacterThoughts = swipeData.characterThoughts; + if (rawCharacterThoughts == null) { + committedTrackerData.characterThoughts = null; + } else if (typeof rawCharacterThoughts === 'object') { + committedTrackerData.characterThoughts = JSON.stringify(rawCharacterThoughts); + } else { + committedTrackerData.characterThoughts = String(rawCharacterThoughts); + } } else { // No saved swipe data — treat as empty (e.g. first message, no prior generation) committedTrackerData.userStats = null;