Skip to content

Add crash report diagnostic log upload#2580

Open
brennanb2025 wants to merge 3 commits into
mainfrom
brennanb2025/report-crash-log-upload
Open

Add crash report diagnostic log upload#2580
brennanb2025 wants to merge 3 commits into
mainfrom
brennanb2025/report-crash-log-upload

Conversation

@brennanb2025
Copy link
Copy Markdown
Contributor

@brennanb2025 brennanb2025 commented May 22, 2026

Summary

This PR wires Orca's existing diagnostic bundle upload capability into crash report submission for both crash-report entry points:

  • captured crash reports shown after a real Electron process crash
  • uncaptured manual reports opened from Help > Report Crash

When the user clicks Send Report, Orca now attempts to include a recent redacted diagnostic log bundle when available. There is no extra native log-upload confirmation in the crash-report flow; the crash report dialog itself discloses that recent redacted diagnostic logs are included when available.

Diagnostic bundle upload remains best-effort. If diagnostics are disabled, the upload endpoint is not configured, bundle collection fails, or upload fails, Orca still sends the crash report text and includes a Diagnostic log section with Status: not uploaded plus the reason.

Help > Report Crash can now send a crash report even when Electron did not capture an automatic crash record. The crash dialog uses neutral manual-report copy when opened from Help: Report a crash instead of Orca closed unexpectedly. Automatic captured-crash prompts still use Orca closed unexpectedly. This PR does not change crash detection/classification or which stored crash report types are selected.

A dev-time white screen was also fixed in the floating terminal panel by guarding the optional preload bridge for setFloatingTerminalInputFocused; if a renderer reload is paired with an older preload, the focus mirror becomes a no-op instead of crashing React.

Screenshots

No screenshot captured. The UI changes are dialog copy/state changes in the existing crash report dialog plus a runtime guard for the floating terminal panel.

Testing

Latest validation after removing the crash-report native log prompt:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/crash-reporting.test.ts src/shared/crash-reporting.test.ts
  • pnpm run typecheck:node
  • pnpm run typecheck:web
  • pnpm exec oxlint src/main/ipc/crash-reporting.ts src/main/ipc/crash-reporting.test.ts src/renderer/src/components/crash-report/CrashReportDialog.tsx

Earlier branch validation:

  • pnpm run typecheck
  • pnpm run lint
  • git diff --check
  • pnpm vitest run --config config/vitest.config.ts src/main/crash-reporting/process-gone-classification.test.ts src/main/ipc/crash-reporting.test.ts src/shared/crash-reporting.test.ts src/renderer/src/components/floating-terminal/FloatingTerminalPanel.test.tsx
  • pnpm test
  • pnpm run build:electron-vite
  • Launched the PR worktree in Electron with isolated user data and verified window.api.app.getIdentity() reported brennanb2025/report-crash-log-upload at /Users/thebr/orca/workspaces/orca/report-crash-log-upload.
  • Registered and activated demo-project in the isolated profile; no real Orca issue or real Orca PR was used as the test target.
  • Exercised the uncaptured manual crash dialog: verified Report a crash copy, No automatic crash report was captured state text, enabled Copy Details / Send Report, and the Optional: what happened? placeholder.
  • Clicked Copy Details and verified the clipboard contained an uncaptured crash report with Report ID: not captured, report_source: help_menu, and redacted path/token/secret text.
  • Clicked Send Report for the no-upload path with a local feedback proxy; verified the main-process feedback POST reached the local /v1/feedback endpoint and no uncaptured crash-reports.json record was created.

AI Review Report

Reviewed the crash-reporting IPC flow, renderer dialog behavior, diagnostic endpoint sharing, and failure cleanup paths. Main risks checked: uncaptured reports still submitting, empty or unavailable logs not blocking feedback, diagnostic bundle upload from both crash-report entry points, uploaded bundle cleanup on feedback failure, renderer surfacing an unlinked ticket when cleanup fails, and Help-menu copy not implying a detected crash when the user manually opens the report flow.

Reviewed the floating terminal preload mismatch fix for failure mode containment. The guard is intentionally narrow: it only prevents a missing optional preload function from taking down the renderer; it does not change shortcut handling when the bridge exists.

Cross-platform compatibility was checked for the touched code. The change uses Electron/native APIs and existing Node path-independent diagnostics plumbing; no keyboard shortcuts, shortcut labels, shell behavior, or platform-specific path construction were added.

Security Audit

Reviewed IPC and upload boundaries. Diagnostic upload still happens only in main, uses the existing pinned diagnostics endpoint resolution rules, and never gives the renderer direct endpoint access. Crash report notes and diagnostic metadata are sanitized before inclusion in feedback text. Diagnostic bundles use the existing redacted bundle payload path, and cleanup attempts to delete uploaded bundles if the feedback post fails.

No new command execution, dependency, auth-token handling, renderer-supplied upload payload path, or crash-classification filtering was introduced.

Notes

The behavioral contract is: when the user clicks Send Report, crash report text should submit from both captured crashes and Help > Report Crash, and recent redacted diagnostic logs should be included when available. A submitted crash report may therefore have Diagnostic log: Status: uploaded with a ticket ID, or Diagnostic log: Status: not uploaded with a reason.

Official builds must have ORCA_DIAGNOSTICS_TOKEN_URL configured for diagnostic log upload to work. Without that endpoint, crash report text still sends, but the diagnostic bundle cannot upload.

brennanb2025 and others added 3 commits May 21, 2026 18:56
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
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