Skip to content

feat(desktop): make diagnostics packages agent-readable JSON#1475

Open
Astro-Han wants to merge 2 commits into
devfrom
codex/i1465-agent-readable-diagnostics
Open

feat(desktop): make diagnostics packages agent-readable JSON#1475
Astro-Han wants to merge 2 commits into
devfrom
codex/i1465-agent-readable-diagnostics

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces the saved diagnostics package body with pure, pretty JSON instead of a Markdown wrapper. The JSON now uses stable top-level sections for meta, environment, error, recentErrors, session, rendererDiagnostics, and logTail, with logTail saved as an array of lines.

Also switches newly saved report files from .md to .json, bumps the report contract to meta.reportVersion: 2, updates cleanup/file-writing expectations, and moves the smoke test assertions from Markdown-string checks to JSON payload checks.

Why

Part of PR4 for the diagnostics package rebuild: make the package easier for agents and support tooling to read directly, without first stripping prose or fenced code blocks.

Related Issue

Part of #1465.

Human Review Status

Pending

Review Focus

Please focus on the JSON contract shape, especially the stable top-level keys, meta.reportVersion: 2, meta.truncation, error: null | object, and logTail: string[].

Also worth checking: this intentionally drops legacy Markdown parser compatibility for full reports, following the product decision for PR4. Legacy .md report files are only kept in the cleanup matcher so old local diagnostics packages still age out.

Risk Notes

Legacy .md diagnostics reports are no longer parsed by the local parser and new reports are always generated as .json. Cleanup still recognizes legacy pawwork-problem-report-*.md files so existing local support packages do not fall out of retention. Saved reports are local support artifacts, so there is no data migration.

Visible UI checklist left unticked: no layout or user-facing copy changed. The generated filename extension shown in the review flow changes from .md to .json and is covered by focused tests and smoke.

How To Verify

bun test src/main/problem-report-redact.test.ts src/main/problem-report-files.test.ts src/main/feedback.test.ts src/main/problem-report.test.ts: 123 passed
bun test src/components/diagnostics-review.test.tsx: 6 passed
bun run build: passed, with existing Vite/eval warnings only
bun run smoke:report: passed; saved pawwork-problem-report-*.json and JSON assertions were true
GOMAXPROCS=2 bun run typecheck: passed
git diff --check: passed

Screenshots or Recordings

Not applicable. No visual UI layout change.

Checklist

How to use this checklist:

  • Tick a box by replacing [ ] with [x]. Do not edit, add, or remove items.
  • The bot-applied label items can only be honestly ticked AFTER the PR is opened and the labeler / priority-triage bots have run — return to the PR description and tick them then.
  • Most items are required. The few that are conditional are explicitly marked (conditional); for those, leave unticked if they truly do not apply and explain why in Risk Notes. All other items must be ticked before requesting human review.
  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.

@Astro-Han Astro-Han added P3 Low priority platform Electron shell, OS integration, packaging, updater, signing, paths, and permissions task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work labels Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 32 minutes and 21 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 09332382-239d-475f-95cb-8b33d61a53b5

📥 Commits

Reviewing files that changed from the base of the PR and between 72dbabd and 3931a9f.

📒 Files selected for processing (9)
  • packages/app/src/components/diagnostics-review.test.tsx
  • packages/desktop-electron/scripts/report-problem-smoke.mjs
  • packages/desktop-electron/src/main/feedback.test.ts
  • packages/desktop-electron/src/main/feedback.ts
  • packages/desktop-electron/src/main/problem-report-files.test.ts
  • packages/desktop-electron/src/main/problem-report-files.ts
  • packages/desktop-electron/src/main/problem-report-redact.test.ts
  • packages/desktop-electron/src/main/problem-report.test.ts
  • packages/desktop-electron/src/main/problem-report.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/i1465-agent-readable-diagnostics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added app Application behavior and product flows ui Design system and user interface P2 Medium priority and removed P3 Low priority labels Jun 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested priority: P2 (includes user-path files (packages/app/src/components/diagnostics-review.test.tsx, packages/desktop-electron/src/main/feedback.test.ts, packages/desktop-electron/src/main/feedback.ts, packages/desktop-electron/src/main/problem-report-files.test.ts, packages/desktop-electron/src/main/problem-report-files.ts, packages/desktop-electron/src/main/problem-report-redact.test.ts, packages/desktop-electron/src/main/problem-report.test.ts, packages/desktop-electron/src/main/problem-report.ts)).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows P2 Medium priority platform Electron shell, OS integration, packaging, updater, signing, paths, and permissions task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant