Add debug logging for code execution auto-fix retry logic
This commit is contained in:
parent
54be0761af
commit
d79a9c8117
1 changed files with 13 additions and 0 deletions
|
|
@ -1558,6 +1558,13 @@ async function executeCodeBlock(code, blockElement, playButton) {
|
|||
const stderr = job.stderr || '';
|
||||
const shouldAutoFix = exitCode !== 0 && stderr.trim() !== '';
|
||||
|
||||
console.log('[DEBUG] Code execution completed:', {
|
||||
exitCode,
|
||||
hasStderr: !!stderr,
|
||||
shouldAutoFix,
|
||||
stderr: stderr.substring(0, 100)
|
||||
});
|
||||
|
||||
// Track attempts per code block (store in resultsContainer dataset)
|
||||
if (!resultsContainer.dataset.fixAttempts) {
|
||||
resultsContainer.dataset.fixAttempts = '0';
|
||||
|
|
@ -1565,6 +1572,12 @@ async function executeCodeBlock(code, blockElement, playButton) {
|
|||
|
||||
const currentAttempts = parseInt(resultsContainer.dataset.fixAttempts);
|
||||
|
||||
console.log('[DEBUG] Auto-fix decision:', {
|
||||
shouldAutoFix,
|
||||
currentAttempts,
|
||||
willAttemptFix: shouldAutoFix && currentAttempts < 3
|
||||
});
|
||||
|
||||
if (shouldAutoFix && currentAttempts < 3) {
|
||||
// Show auto-fix message
|
||||
const autoFixDiv = document.createElement('div');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue