fix(skills,cli,trpc): make /feedback reports land on the right thread with the right versions

Merged
KI
2mo ago
+344-94

Summary

  • Rewrite the /feedback skill around what an audit of ~200 private reports showed: follow-ups and retractions open new threads, ~15% of bugs are the host-registration cluster /doctor already covers, reports arrive from stale versions, and wrong root causes land in titles.
  • Fix two pipeline gaps found along the way: the diagnostics bundle was macOS-only and never included host-service.log, and the email's plain-text part collapsed every line break.

Why / Context

The skill's report format is fine; nearly every team reply opens "thanks for the detailed report." The waste is before and after drafting. Concrete cases from the inbox: one user filed three reports in an hour for one relay cutover, another filed a "RETRACTION" report, several filed twice within minutes for one root cause, a feature request asked for folders on 1.22 after they shipped in 1.26, and one "ROOT CAUSE:" title named a file:line that was wrong.

The attachment-size 413 the audit also surfaced was fixed on main by #7214 and #7224 while this was in flight; this PR is rebased on those and only describes that behavior in the skill.

How It Works

Skill (plugins/superset/skills/feedback/SKILL.md)

  • Step 0: if the seed reads like a continuation, ask whether they already sent a report and point them at the CC'd email so it threads.
  • Version check: superset update --check --json for a standalone CLI; the desktop-bundled CLI refuses that command, so fall back to gh release download cli-latest -p version.txt -O - (verified: prints 1.26.0). hostServiceVersion from superset status --json covers the app version when the CLI is standalone.
  • Host/automation/terminal bugs run the doctor snapshot first and carry the status JSON into a "Host status" section.
  • One report per root issue, one request per ask. Findings go in an "Investigation" section labeled Hypothesis:, never in the title or Summary. No unanswered checklists. Environment only on the public path.

Pipeline

  • Diagnostics bundle records the CLI channel, host-service version and registration state, and tails both the app log (macOS, Linux, Windows electron-log paths) and the per-org host-service.log. A stale manifest from a crashed host is reported as dead rather than probed.
  • health.check returns version; superset status --json exposes it as hostServiceVersion. The health probe moves to lib/host/health.ts so status and feedback share it.
  • feedbackReportText builds the text/plain part with real newlines and is passed as text next to react. The "customer since" date is pinned to UTC so both parts agree in any timezone.

Manual QA Checklist

  • superset feedback submit --diagnostics on a machine with a running host: bundle lists CLI channel, host-service version, and both log tails
  • Same with no host running: bundle says "Host service: not running" and still submits
  • Same with a leftover manifest from a crashed host: bundle says "stale manifest, pid N is dead"
  • superset status --json against a host-service from this build shows hostServiceVersion; against an older host-service the key is absent
  • Received email: plain-text alternative keeps Summary bullets on separate lines

Testing

  • tsc --noEmit in cli, trpc, email, host-service
  • biome check on changed files, sherif clean
  • bun test in packages/cli (feedback, status, host lib: 15 pass) and packages/host-service trpc (697 pass)
  • New test feedback-report.test.ts (text part keeps line breaks, metadata parity, optional lines dropped), also run under TZ=America/Los_Angeles
  • packages/email had no test script or bun types; added both so the new test typechecks and runs in CI

Known Limitations

  • The email template's toLocaleDateString("en-US") predates this PR; I moved it into a helper shared by both renderers and pinned the zone, but did not change the locale.
  • The superset plugin's skills ship with desktop releases and are not gated by check:plugins, so users see the new skill text on their next app update.

https://claude.ai/code/session_01DhL3LXZu9TuGRwwx1gmraw

Summary by CodeRabbit

  • New Features

    • Feedback submissions now support smarter attachment handling, including size limits and tail-preserved oversized files.
    • Diagnostic reports include relevant desktop and host-service details across platforms.
    • Host status checks now report host-service version information.
    • Feedback reports now include a matching plain-text email format.
  • Bug Fixes

    • Improved handling and messaging for rejected feedback requests.
    • Host health checks now behave consistently, including during timeouts and connection failures.
  • Documentation

    • Updated feedback guidance with host troubleshooting, diagnostics, follow-up detection, and attachment instructions.