Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(desktop): contain localized crashes with inline error boundaries

3 months ago

70d9f75
Authored
mweinbach6/17/2026, 8:39:09 PM
Previously the only React error boundary was at the app root
(CrashReportingErrorBoundary), which replaces the entire window with a
'Reload' screen. A malformed feed item, a bad agent-generated a2ui surface,
a canvas, or a settings panel taking the whole window down is especially
bad in the separate popout quick-chat / menu-bar / canvas renderer
processes.

- CrashReportingErrorBoundary.tsx: add InlineErrorBoundary class with the
  same telemetry forwarding (operation=react_inline_error_boundary) plus a
  small inline destructive-toned fallback tile ('This ... couldn't be
  rendered.' + Retry) mirroring FeedRow error rows and the a2ui
  UnknownComponent tile. The root boundary stays as the window backstop.
- ChatFeed.tsx: wrap each FeedRow so one bad item degrades to one tile
  instead of killing the feed (label includes the item kind).
- A2uiRenderer.tsx: wrap the root RenderNode so a bad model surface
  degrades to one tile.
- App.tsx: wrap both Canvas call sites (canvas window + right-pane canvas).
- SettingsShell.tsx: wrap activePage.render() so a broken settings panel
  doesn't blank the settings shell.
- test/inline-error-boundary.test.tsx: lock in fallback render, telemetry
  forwarding, retry reset, custom fallback, and that the root boundary
  still renders its fullscreen backstop.

Parenta7bfa1c

6 files changed
  • apps/desktop/src/App.tsx+11−2
  • apps/desktop/src/ui/CrashReportingErrorBoundary.tsx+99−0
  • apps/desktop/src/ui/chat/ChatFeed.tsx+13−8
  • apps/desktop/src/ui/chat/a2ui/A2uiRenderer.tsx+9−1
  • apps/desktop/src/ui/settings/SettingsShell.tsx+4−1
  • apps/desktop/test/inline-error-boundary.test.tsx+156−0