Skip to content

fix(diagnostics): collect redacted bundles off the main thread - #35587

Closed
OrcaWin wants to merge 1 commit into
mainfrom
audit/diagnostic-bundle-worker
Closed

OrcaWin wants to merge 1 commit into
mainfrom
audit/diagnostic-bundle-worker

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

LoC: +247/-6

Creating a diagnostic review file or attaching crash feedback can synchronously read and parse ten retained 10 MiB log files on Electron's main thread, even when the result contains no recent records. Run the unchanged collector in a lazy, serialized worker through the existing request queue. Preserve flush-before-collect, record order, redaction, daemon reservation and the 4 MiB payload cap. Bound waiting calls, reject worker failures without a main-thread fallback, and retire on idle, timeout and observability shutdown.

Validation: 126 tests in six suites, strict focused TypeScript and all five ordinary commit checks pass. Real Node26.8.1/Linux production observability entry and worker: at ten files, 794,370+ main-thread parses become zero while the worker performs the same reads/parses and returns identical record bytes. A 20 ms main-loop timer's observed delay falls from 969–1,167 ms to 0–0.74 ms. Capped traces/daemon content, Unicode/redaction and newly flushed actions are preserved; all six workers and owned fixture directories retire. Executed final bundles rebuild byte-identically from the frozen commit. Build registration, actual worker graph Electron-import rejection control and four path layouts pass.

These are local Node event-loop measurements, not Electron frame/CPU/RSS or actual macOS/Windows/remote runtime proof. Total collection latency is not claimed faster. No installs or native ABI repair. Preserve adjacent diagnostic transport fixes #35496/#35555 on rebase.

Aggregate is queued after #35566; no pass or Claude takeover claimed. Head 86ed4411235f9bcb321658b3962cf6e79a738d9c, parent 79dbada2c873bef3584a0c53b23ae98f2a84e536. Evidence /home/neil/.local/state/orca-electron-audit/diagnostic-bundle-worker/report.md; 86-payload seal db312ceccd3fd8b6a1ef649d5cd85927043d89c1c29d1717e864dbc2a56237bc.

@OrcaWin

OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Closing. Bundle collection runs only when a user explicitly asks for it, and it stops early once the 4 MiB budget is full, so the main-thread stall is rare and about 1s at worst. Moving it into a worker adds a new build entry in four config lists. It also adds new ways for diagnostics to fail (missing entry, crash loop, timeout, queue full) with no synchronous fallback, and diagnostics are most needed when the app is already broken. The PR also conflicts with main.

Closing per maintainer triage (low-risk / zero user trade-off / material-gain bar).

@OrcaWin OrcaWin closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant