Repository navigation
feat(diagnostics): add an opt-in log for UI hangs - #15
Merged
Merged
Conversation
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
force-pushed
the
nplez1/Debug-Options
branch
from
September 21, 2026 17:37
e99414a to
27c3000
Compare
nplez1
added a commit
that referenced
this pull request
Sep 21, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
added a commit
that referenced
this pull request
Sep 22, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
added a commit
that referenced
this pull request
Sep 25, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
added a commit
that referenced
this pull request
Sep 27, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
added a commit
that referenced
this pull request
Sep 29, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
added a commit
that referenced
this pull request
Oct 1, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
nplez1
added a commit
that referenced
this pull request
Oct 6, 2026
Users who hit repeated hangs had no way to hand us evidence: the only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic most people never set. Settings → Advanced → Debug Options now has a "Log UI hangs" switch, off by default. While it is on, Orca appends NDJSON to logs/ui-hangs.ndjson and the pane shows that exact path, so the file can be collected without hunting through the logs folder. The toggle applies immediately; no restart. One file now captures the three distinct ways the UI stops responding: - `stall` — the renderer's own UI thread was blocked for 250 ms or more, measured by a tick-vs-clock watchdog that survives system sleep. - `main-stall` — the same measurement on the main process, where a blocked event loop freezes IPC and terminal input even though the renderer keeps painting. These records also name the subprocess spawns that blocked the thread, reusing the spawn-initiation timing the git runners already take. - `window-unresponsive` / `window-responsive` — Electron's coarse window signal, with the recovered duration on the responsive half. A `ui-hang-meta` header records the app version, platform, arch, and OS release so a collected file is traceable to a release. Reuses the existing rotating NDJSON sink and honors the same local-file consent boundary as the trace lane (CI / ORCA_DIAGNOSTICS_DISABLED). Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data. The env-gated ORCA_MAIN_THREAD_DIAGNOSTICS churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared. Tests: ui-hang-log-sink, main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, and the preload composition; tc:node, tc:web, the changed-code quality gate, and the localization checks pass. A hidden-Electron rendered proof (tests/tools/ui-hang-logging-ui) captures the pane before and after the switch is flipped.
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.
ELI5
Sometimes the Orca window freezes. There was no way to record what happened when it did, so "it froze again" was all we could go on. This adds a switch that writes a detailed log of those freezes to a file you can send us.
What Changed
Before: nothing captured a hang. The only existing signal was a macOS watchdog marker consumed on the next launch, and the main-thread probe is an env-var diagnostic (
ORCA_MAIN_THREAD_DIAGNOSTICS=1) most people never set. A user hitting a hang repeatedly had no evidence to hand over.After: Settings → Advanced → Debug Options has a new Log UI hangs switch, off by default. While it is on, Orca appends NDJSON to
<userData>/logs/ui-hangs.ndjson, and the pane shows that exact path — plus a note when local writes are disabled by policy (CI /ORCA_DIAGNOSTICS_DISABLED). The toggle applies immediately; no restart.One file now captures every way the UI stops responding:
stallmain-stallwindow-unresponsive/window-responsiveui-hang-metaMechanism: a timer that fires late by N ms proves that thread was blocked for N ms. One shared detector (with a sleep/resume guard so waking a laptop never logs a fake hang) backs both the renderer and main probes, so their durations are directly comparable. Main-stall attribution reuses the spawn-initiation timing the git runners already measure — no new call sites and no parallel collector.
Why
The alternative was to keep the main-thread probe env-gated and ask users to relaunch with
ORCA_MAIN_THREAD_DIAGNOSTICS=1, which is unrealistic for the people actually hitting hangs. Turning it into a setting that writes a plain, self-describing file means someone can collect evidence without a debugger or a terminal, and we can see the build it came from.I reused the existing rotating NDJSON sink and the same local-file consent boundary as the trace lane rather than building a second logging path. Renderer samples are normalized at the IPC boundary and cannot inject main-only fields; records carry only timing, source, surface, and visibility — never terminal contents, URLs, env, or account data.
The env-gated churn probe and the macOS hang watchdog are unchanged; only their spawn collector is now shared.
Linked Issue
No tracking issue — this was requested directly.
Visual Proof
Before: the Advanced pane had no Debug Options section. After, rendered from the production
AdvancedPanein a hidden Electron window (tests/tools/ui-hang-logging-ui/run.mjs):The "on" shot is the change the feature is about: flipping the switch reveals the
ui-hangs.ndjsonpath to collect.Testing
pnpm tc:node,pnpm tc:webpnpm run check:code-quality:changed, plus the max-lines, runtime-electron, and rpc-params-catalog gatesui-hang-log-sink,main-thread-stall-probe, the renderer probe, the window observer, the Debug Options pane, the preload composition test, and the startup / settings-IPC suites — all passVerified on macOS. Not manually tested on Linux or Windows, and not exercised over SSH. The feature is desktop-only (the Advanced pane is desktop-gated) and the web client gets a deliberate no-op stub.
AI Disclosure
Authored with an AI coding agent (pi,
deepseek-flash) under human direction. Every change was reviewed and verified against the repo's gates and tests.Review
Start with
src/shared/ui-hang-diagnostics-types.ts(the record shape), thensrc/main/diagnostics/ui-hang-log-sink.ts(the untrusted-input boundary) andsrc/main/diagnostics/main-thread-stall-probe.ts(the main-process detector plus spawn attribution). The renderer side issrc/renderer/src/lib/ui-hang-diagnostics/and the UI isUiHangDiagnosticsSetting.tsx.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass — typecheck, the changed-code quality gate, and targeted tests ran locally; the fullpnpm testandpnpm buildwere not run on this machine (CI will cover).