From 9f3ee18e4ebdb45c3cff9b587de0730b0dd868dd Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Thu, 6 Nov 2025 23:02:11 +1100 Subject: [PATCH] debug: add code block extraction logging Add detailed logging to trace Skills section through code block extraction. New logs in parseResponse: - Log each code block's content length - Check if code block contains 'Skills:' - If yes, show 200 chars of text around Skills section - This runs BEFORE the content is categorized as userStats/infoBox/etc This will show us: 1. Is Skills section in the extracted code block? 2. At what point does it get truncated? 3. Is it a code block extraction issue or later processing? Related: Skills categorization debugging --- src/systems/generation/parser.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/systems/generation/parser.js b/src/systems/generation/parser.js index f240b9b..5969f40 100644 --- a/src/systems/generation/parser.js +++ b/src/systems/generation/parser.js @@ -328,7 +328,13 @@ export function parseResponse(responseText) { const content = match[1].trim(); debugLog(`[RPG Parser] --- Code Block ${i + 1} ---`); + debugLog('[RPG Parser] Content length:', content.length); debugLog('[RPG Parser] First 300 chars:', content.substring(0, 300)); + debugLog('[RPG Parser] Contains "Skills:":', content.includes('Skills:')); + if (content.includes('Skills:')) { + const skillsIndex = content.indexOf('Skills:'); + debugLog('[RPG Parser] Text around Skills (index ' + skillsIndex + '):', content.substring(skillsIndex, skillsIndex + 200)); + } // Check if this is a combined code block with multiple sections const hasMultipleSections = (