From 65873555bcb2674c05fb7af9712936b76629e6f7 Mon Sep 17 00:00:00 2001 From: KoalaTrapLord Date: Sun, 5 Apr 2026 16:35:21 +0000 Subject: [PATCH] fix: show all batch log lines in Live Output (was truncated to last 30) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frontend: removed .slice(-30) — now shows all lines from backend. Backend: bumped log line limit from 200 to 2000 so full Forge game output is captured for debugging. --- routes/lab.py | 2 +- ui/ai-lab.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/routes/lab.py b/routes/lab.py index 96ce72e..5acb674 100644 --- a/routes/lab.py +++ b/routes/lab.py @@ -454,7 +454,7 @@ async def get_log(batchId: str): state = active_batches.get(batchId) if not state: raise HTTPException(404, f"Batch {batchId} not found") - return {"lines": state.log_lines[-200:]} + return {"lines": state.log_lines[-2000:]} @router.get("/api/lab/debug-log") diff --git a/ui/ai-lab.js b/ui/ai-lab.js index 626ec83..bdea712 100644 --- a/ui/ai-lab.js +++ b/ui/ai-lab.js @@ -1397,9 +1397,8 @@ const AiLab = (() => { const data = await res.json(); const logEl = document.getElementById('lab-log-content'); if (logEl && data.lines) { - // Show last N lines - const tail = data.lines.slice(-30); - logEl.textContent = tail.join('\n'); + // Show all lines from the backend (up to 200) + logEl.textContent = data.lines.join('\n'); logEl.scrollTop = logEl.scrollHeight; } } catch { /* ignore */ }