fix: surface engine logs in dashboard TUI via console capture

The dashboard TUI Logs tab only showed the handful of lines emitted
through DashboardLogSink directly. Everything from @fusion/engine
(scheduler, executor, triage, merger, PR monitor, heartbeat, etc.)
logs via createLogger() which writes straight to console.error —
bypassing the sink. Under the TUI's alt screen those writes either
overdrew the frame or scrolled off, leaving the Logs tab near-empty.

DashboardLogSink now offers captureConsole() / releaseConsole():
while the TUI is running, console.log/warn/error are intercepted
and routed into the ring buffer. A leading `[prefix]` tag is
extracted so entries carry the subsystem name. Original console
functions are restored (by identity) on TUI shutdown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-23 12:05:48 -07:00
parent 316e94d653
commit b6d69ea85e
4 changed files with 255 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Dashboard TUI now surfaces engine log output in the Logs tab. Previously, the engine's `createLogger()` writes (scheduler, executor, triage, merger, PR monitor, heartbeat, etc.) went straight to `console.error` and were rendered beneath the alt-screen TUI — effectively invisible. `DashboardLogSink.captureConsole()` now intercepts `console.log/warn/error` while the TUI is running and routes each line into the ring buffer, parsing a leading `[prefix]` tag so entries carry the subsystem prefix. Originals are restored on TUI shutdown.