Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 26, 2025

Summary

This PR implements comprehensive crash recovery mechanisms and Windows-specific error handling to address the frequent crashes reported in issue #6257.

Changes

🛡️ Global Error Handling

  • Added global error handlers for uncaught exceptions and unhandled promise rejections
  • Implemented crash information persistence for recovery on restart
  • Added crash telemetry logging for better debugging

🪟 Windows-Specific Improvements

  • Added Windows-specific signal handlers (SIGTERM, SIGINT, exit)
  • Enhanced error detection for Windows-specific patterns (EPERM, EACCES, ENOENT, spawn errors)
  • Added Windows-specific messaging in crash recovery dialogs

🔄 Crash Recovery Features

  • Enhanced ErrorBoundary component with user-friendly crash recovery UI
  • Added "Restart VS Code" and "Report Issue" buttons in the error boundary
  • Implemented task state persistence during crashes
  • Added automatic session restoration on restart after crash

🎯 Subtask Recovery

  • Implemented subtask recovery mechanism that restores parent task context
  • Shows appropriate messaging when recovering from subtask crashes
  • Maintains task stack information for debugging

Testing

  • All existing tests pass ✅
  • Linting passes with no warnings ✅
  • Type checking passes ✅

Screenshots

The enhanced ErrorBoundary now shows:

  • Clear error message with Windows-specific detection
  • Restart VS Code button for quick recovery
  • Report Issue button for GitHub issue creation
  • Improved error details formatting

Fixes #6257


Important

This PR adds crash recovery and Windows-specific error handling, enhancing global error handling, UI, and telemetry logging.

  • Global Error Handling:
    • Adds global error handlers for uncaught exceptions and unhandled promise rejections in extension.ts.
    • Implements crash information persistence and telemetry logging.
  • Windows-Specific Improvements:
    • Adds Windows-specific signal handlers for SIGTERM, SIGINT, and exit in extension.ts.
    • Detects Windows-specific errors like EPERM, EACCES, ENOENT, and spawn errors.
  • Crash Recovery Features:
    • Enhances ErrorBoundary component in ErrorBoundary.tsx with crash recovery UI.
    • Adds "Restart VS Code" and "Report Issue" buttons.
    • Implements task state persistence and automatic session restoration.
  • Subtask Recovery:
    • Implements subtask recovery mechanism in extension.ts.
    • Maintains task stack information for debugging.
  • Misc:
    • Adds reloadWindow case to webviewMessageHandler in webviewMessageHandler.ts.
    • Updates common.json with new error boundary messages.

This description was created by Ellipsis for 6fd883d. You can customize this summary. It will automatically update as commits are pushed.

- Add global error handlers for uncaught exceptions and promise rejections
- Implement crash information persistence for recovery on restart
- Add Windows-specific signal handlers (SIGTERM, SIGINT, exit)
- Enhance ErrorBoundary component with user-friendly crash recovery UI
- Add restart functionality from ErrorBoundary
- Implement task state persistence during crashes
- Add subtask recovery mechanism to restore parent task context
- Integrate crash telemetry logging
- Add Windows-specific crash detection and messaging

Fixes #6257
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 26, 2025 23:36
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jul 26, 2025
{this.state.isRecovering ? (
<>
<span className="codicon codicon-loading codicon-modifier-spin mr-2"></span>
{t("errorBoundary.restarting", "Restarting...")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using inline English fallback strings in translation calls (e.g. t('errorBoundary.restarting', 'Restarting...')). Instead, rely solely on translations defined in your i18n JSON to meet our i18n guidelines.

Suggested change
{t("errorBoundary.restarting", "Restarting...")}
{t("errorBoundary.restarting")}

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

"restartVSCode": "Restart VS Code",
"reportIssue": "Report Issue",
"technicalDetails": "Technical Details",
"helpText": "If the problem persists, please"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo/Incomplete text: The 'helpText' string reads 'If the problem persists, please'. Consider completing this sentence for clarity.

Suggested change
"helpText": "If the problem persists, please"
"helpText": "If the problem persists, please contact support."

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 26, 2025
@daniel-lxs
Copy link
Member

Closing, issue is not properly scoped

@daniel-lxs daniel-lxs closed this Jul 29, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 29, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

crashing all the time on windows

4 participants