feat(observability): file logging, crash handlers, per-run script logs, toast queue#51
Merged
Conversation
…s, toast queue Before this the main process logged nothing, had no crash/rejection handlers, and script stdout/stderr was parsed then discarded — a user hitting a bug could send us a screenshot of an 8s toast and nothing else. Main process: - logger.ts: leveled file logger at userData/logs/main.log (rotated at 2MB, one backup), mirrored to the dev console. - installCrashHandlers() for uncaughtException/unhandledRejection; render-process-gone + unresponsive logging on the window. - runScriptArgs tees each engine-script run's full stdout+stderr to userData/logs/scripts/<prefix>-<ts>.log and logs start/exit. - app:info IPC (version/electron/chrome/node/platform/logsDir) so a report can be correlated to a build; log:renderer IPC. Renderer: - window.onerror / onunhandledrejection and the ErrorBoundary now persist to the shared log via log:renderer (previously only a closed DevTools). - Toast is now a queue (notices[]): concurrent operations no longer overwrite each other's messages; errors persist until dismissed (with a close button + role=alert) while info auto-dismisses. Fixes the dismiss-timer-resets-on-every-App-render bug by keying per notice id. - Replaced the raw #c0392b toast hex with --foreground-danger. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit roadmap Phase 5 (observability foundation). Before this, the main process logged nothing, had no crash/rejection handlers, and engine-script stdout/stderr was parsed then discarded — when something broke, a user could send us a screenshot of an 8-second toast and nothing else. This is also Stage 1 of the debug-console recommendation: the logging/version substrate a report bundle or command palette would build on.
Main process
logger.ts: leveled file logger atuserData/logs/main.log(rotated at 2 MB, one backup), mirrored to the dev console.installCrashHandlers()foruncaughtException/unhandledRejection;render-process-gone+unresponsivelogged on the window.runScriptArgstees each script run's full stdout+stderr touserData/logs/scripts/<prefix>-<ts>.logand logs start/exit.app:infoIPC (version / electron / chrome / node / platform / logsDir) so a report can be correlated to a build;log:rendererIPC.Renderer
window.onerror/onunhandledrejectionand theErrorBoundarynow persist to the shared log vialog:renderer(previously only a usually-closed DevTools console saw them).notices[]): concurrent operations no longer overwrite each other's messages; errors persist until dismissed (close button,role="alert") while info auto-dismisses. Fixes the bug where the dismiss timer restarted on every App re-render (so an error toast shown mid-edit never cleared) by keying per notice id.#c0392btoast hex with--foreground-danger(token).Main-process + preload change — restart
npm run dev.Test plan
userData/logs/scripts/…;main.logrecords startup + script runsMade with Cursor