Add crash report diagnostic log upload#2580
Open
brennanb2025 wants to merge 3 commits into
Open
Conversation
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR wires Orca's existing diagnostic bundle upload capability into crash report submission for both crash-report entry points:
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 logsection withStatus: not uploadedplus 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 crashinstead ofOrca closed unexpectedly. Automatic captured-crash prompts still useOrca 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.tspnpm run typecheck:nodepnpm run typecheck:webpnpm exec oxlint src/main/ipc/crash-reporting.ts src/main/ipc/crash-reporting.test.ts src/renderer/src/components/crash-report/CrashReportDialog.tsxEarlier branch validation:
pnpm run typecheckpnpm run lintgit diff --checkpnpm 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.tsxpnpm testpnpm run build:electron-vitewindow.api.app.getIdentity()reportedbrennanb2025/report-crash-log-uploadat/Users/thebr/orca/workspaces/orca/report-crash-log-upload.demo-projectin the isolated profile; no real Orca issue or real Orca PR was used as the test target.Report a crashcopy,No automatic crash report was capturedstate text, enabledCopy Details/Send Report, and theOptional: what happened?placeholder.Copy Detailsand verified the clipboard contained an uncaptured crash report withReport ID: not captured,report_source: help_menu, and redacted path/token/secret text.Send Reportfor the no-upload path with a local feedback proxy; verified the main-process feedback POST reached the local/v1/feedbackendpoint and no uncapturedcrash-reports.jsonrecord 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 haveDiagnostic log: Status: uploadedwith a ticket ID, orDiagnostic log: Status: not uploadedwith a reason.Official builds must have
ORCA_DIAGNOSTICS_TOKEN_URLconfigured for diagnostic log upload to work. Without that endpoint, crash report text still sends, but the diagnostic bundle cannot upload.