Repository navigation
[Feat] Add privacy-safe diagnostics reports - #2292
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
|
Re-reviewing new commits now. Follow
Reviewing d130eb1 |
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: The required review sequence passed. Remaining merge requirements apply. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
15596b6 to
d930b12
Compare
Supersedes #1172. This PR recreates that closed, unmerged PR on the current
main.Related GitHub Issue
None. This PR supersedes #1172, which was closed unmerged before review. #1172 had no linked issue.
Description
Adds the
Zoo Code: Create Diagnostics Reportcommand to the Command Palette. The command helps users troubleshoot blank or unresponsive webviews, missing history, and failed task or subtask navigation.The command collects a bounded, structural report and writes it to a temporary JSON file. The extension opens that file and copies the JSON to the clipboard. The report contains version and environment metadata, provider and task state, navigation events, task persistence integrity, webview hydration and sequence state, and theme colors. Failed navigation targets are inspected. Runtime errors appear as fingerprints only.
The report protects privacy. Task identifiers become report-local pseudonyms. The report excludes conversation content, secrets, identity information, file paths, and raw logs. Nothing is uploaded.
Key points for reviewers:
src/services/diagnostics/module: recorder, request broker, report builder, persistence inspector, and command entry point.ClineProviderrecords boundary events (provider, webview-in, webview-out, task-history, task-navigation) and answers webview diagnostics requests through a request broker.main. Main added a stale-view guard and a webview heartbeat watchdog. Diagnostics recording runs after the stale-view check. The dispose path keeps the watchdog stop before the diagnostics record. The persistence inspector reads the legacy_index.jsonby literal name, because current main removedGlobalFileNames.historyIndex. Installs upgraded from older versions may still have that file on disk.Test Procedure
Automated checks, run from the repository root:
pnpm --dir src run check-typespnpm --dir webview-ui run check-typespnpm --dir src exec vitest run services/diagnostics --config vitest.services.config.tspnpm --dir src exec vitest run activate/__tests__/registerCommands.spec.ts --config vitest.misc.config.tspnpm --dir src exec vitest run core/webview/__tests__/ClineProvider.spec.ts --config vitest.core.config.tspnpm --dir webview-ui exec vitest run src/utils/__tests__/diagnostics.spec.ts src/context/__tests__/ExtensionStateContext.spec.tsx src/__tests__/App.spec.tsx src/__tests__/ErrorBoundary.spec.tsxpnpm testManual check: run the
Zoo Code: Create Diagnostics Reportcommand. The report opens in the editor and the JSON lands in the clipboard.Pre-Submission Checklist
src/test-utils/,@/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.Visual Snapshots
No visual change to report. The feature adds a command and diagnostics collection. Webview rendering does not change.
Videos (interaction / animation only)
No interaction or animation change to report.
Documentation Updates
Additional Notes
This PR recreates the two commits of #1172 on the current
main. Conflict areas resolved against main: message-type unions in@roo-code/types, theregisterCommandsimport block and its spec,ClineProviderwatchdog and heartbeat fields, the dispose path, view visibility listeners, the webview message listener,App.tsxandExtensionStateContext.tsxcontext changes, and the persistence index file name. Validation passed. The fullpnpm testrun shows two intermittentextension.spec.tsfailures under full-suite parallel load. The same failures occur on pristinemain, so they are pre-existing and unrelated to this change.Get in Touch
0x7777777_
Related PRs