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
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-11-06 23:02:11 +11:00
parent 53870857ef
commit 9f3ee18e4e
+6
View File
@@ -328,7 +328,13 @@ export function parseResponse(responseText) {
const content = match[1].trim(); const content = match[1].trim();
debugLog(`[RPG Parser] --- Code Block ${i + 1} ---`); 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] 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 // Check if this is a combined code block with multiple sections
const hasMultipleSections = ( const hasMultipleSections = (