* fix(main): stop the process error guards from logging into a dead stdio sink
#4128 reports the main process freezing with an `EIO` write error raised from
`logError` -> `console.error`. That is the same feedback loop as #4136: the
guard writes diagnostics through the sink that just failed, the failure comes
back as another process-level error, and the handler logs again.
The `ignore` short-circuit that fixed the terminal worker does not cover this
one, because `EIO` is not a benign stream teardown: it is classified as
`suppress`, which logs.
- Add `createDiagnosticLogger()`. It holds an `error` listener on the
diagnostics streams so a failed stdio write is no longer re-raised as an
uncaught exception, and it latches closed after an async sink error or a
synchronous throw, so later diagnostics are dropped instead of re-entering.
- Use it for the main-process logger and warner in `main.cjs`.
Errors are still captured for the crash log through `captureError`.
* fix(error-guards): forward the first stdio failure to the crash log
createDiagnosticLogger holds an `error` listener on stdout/stderr, so it
consumes the stream failure before the process guards can see it. Once the
sink latched closed, the failure was dropped from the crash log entirely:
a closed stdout pipe produced one report before the sink guard landed and
none after.
- Add an `onError` option to `createDiagnosticLogger`. It latches the sink
closed first, then forwards only the first stream error; a throwing
reporter cannot escape.
- Main process: report the failure through
`crashLogBridge.captureError("stdio", err)`.
- Terminal worker: fold the inline `consoleBroken` latch onto
`createDiagnosticLogger` and forward the first failure through
`report`/`reportWorkerError`.
Regression coverage spawns a subprocess whose stdout/stderr pipe is closed
by the parent and asserts exactly one report is produced.
* ci: retrigger tests after unrelated plugin SIGKILL flake
PluginLogSettings.test.tsx was SIGKILL'd and the lint-and-test job was
canceled; the failure is unrelated to the stdio guard change.
---------
Co-authored-by: shibo.li <shibo.li@d-robotics.cc>
Co-authored-by: 陈大猫 <16399091+binaricat@users.noreply.github.com>