Skip to content

fix(renderer): make workbench errors recoverable#888

Closed
luoye520ww wants to merge 2 commits into
KunAgent:developfrom
luoye520ww:codex/fix-885-renderer-error-boundary
Closed

fix(renderer): make workbench errors recoverable#888
luoye520ww wants to merge 2 commits into
KunAgent:developfrom
luoye520ww:codex/fix-885-renderer-error-boundary

Conversation

@luoye520ww

@luoye520ww luoye520ww commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

A renderer exception previously left users with a minimal reload-only screen and could expose raw exception text. That made the #885 white-screen path difficult to recover and unsafe to report.

Root cause

AppErrorBoundary rendered the original exception message and logged unbounded stack data without a stable incident identifier or recovery diagnostics actions.

Scope

Part of #885. This PR only hardens the renderer boundary and the packaged smoke click reliability; runtime exit classification, crash-loop handling, Safe Mode, and process recovery remain separate PRs.

Changes

  • Generate a stable per-failure renderer error ID.
  • Redact and bound renderer error details before console/main-process logging.
  • Keep the fallback page generic instead of rendering exception contents.
  • Add reload-workbench, copy-error-ID, and open-logs actions using existing bridge APIs.
  • Focus the packaged workbench before the CDP contribution click so Linux Xvfb reliably creates the extension guest target.
  • Add English and Chinese copy plus regression tests.

Safety

  • Error messages, stacks, and component stacks are redacted and bounded.
  • The fallback does not render provider credentials or raw exception text.
  • Existing bridge APIs are used; no new privileged renderer bridge is introduced.

Typecheck

npm.cmd run typecheck

Passed locally.

Tests

npm.cmd exec vitest run src/renderer/src/components/AppErrorBoundary.test.ts
node --test scripts/smoke-packaged-extension-desktop.test.cjs
npm.cmd run lint -- --quiet
npm.cmd run build

Results: 5 boundary tests passed; 16 packaged desktop smoke helper tests passed; lint and build passed.

CI note

The previous Linux failure timed out before the extension guest appeared; the workbench is now explicitly foregrounded before the click. The previous Windows failure was GitHub Actions infrastructure (Failed to resolve action download info: Service Unavailable) before checkout/build, not a project failure. A real Linux/Windows packaged artifact run remains CI validation.

Issue

Part of #885

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated runtime recovery PR #947, which passed Typecheck, Linux, macOS, and Windows packaged checks. Closing this duplicate to keep the review surface focused.

@luoye520ww luoye520ww closed this Jul 14, 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