Skip to content

feat(diagnostics): clearer paste-failure errors + one-click bug report - #5

Merged
letsgetrusty merged 2 commits into
mainfrom
feat/diagnostics-bug-report
Sep 2, 2026
Merged

letsgetrusty merged 2 commits into
mainfrom
feat/diagnostics-bug-report

Conversation

@letsgetrusty

Copy link
Copy Markdown
Owner

Why

A user hit a paste failure that surfaced only as paste failed: synthesize Cmd+V and gave up. The anyhow chain was formatted with {e}, which collapses to the outermost context and hides the real cause (almost always enigo's Accessibility check — enigo 0.6 hard-errors in new() when AXIsProcessTrusted is false). There was also no way for a user to send a useful report.

What

  • Full cause chain logged — {e:#} instead of {e}.
  • Cause-aware overlay text via a read-only classify (Accessibility grant + Secure Event Input state — no permission prompts): e.g. "grant Accessibility to Murmur", "Secure Input active (password field / Terminal)".
  • report_bug command + diagnostics module — gathers version, macOS + arch, Accessibility/mic status, Secure Input active, config summary, model presence, and the last 120 log lines; copies the full report to the clipboard and opens a prefilled GitHub issue. Wired to the existing Settings ▸ Support button.

Notes

  • Permission-free: no new prompts, no new dependencies. Both checks (AXIsProcessTrusted, IsSecureEventInputEnabled) are read-only.
  • No dictated text is included — the log records counts/states/errors only.
  • A proactive in-the-moment surface (clickable overlay or tray item) was explored and intentionally deferred; this ships the permission-free core.

Verified

  • Rust: fmt + clippy clean, builds + links (Carbon), 46 tests pass, IPC contract test passes.
  • Frontend: 16 tests pass, build succeeds.
  • Not yet exercised live (overlay text + report button) — needs ./scripts/dev.sh.

🤖 Generated with Claude Code

Paste/injection failures showed the truncated "paste failed: synthesize
Cmd+V" — the anyhow chain collapsed to its outermost context, hiding the
real cause (usually enigo's Accessibility check, since enigo 0.6 hard-errors
in new() when AXIsProcessTrusted is false). That made a real user report
undiagnosable.

- Log the full cause chain ({e:#}) instead of just the top context.
- Cause-aware overlay text via a read-only classify (Accessibility grant +
  Secure Event Input state — no permission prompts): e.g. "grant
  Accessibility to Murmur" or "Secure Input active (password field /
  Terminal)".
- New diagnostics module + report_bug command: gathers version, macOS+arch,
  Accessibility/mic status, Secure Input active, config summary, model
  presence, and the last 120 log lines; copies the full report to the
  clipboard and opens a prefilled GitHub issue. Wired to the existing
  Settings > Support "Report a bug" button.

No dictated text is included (the log records counts/states/errors only).
Permission-free: no new prompts, no new dependencies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhiLhbjf14q4Qc6Cq2Kzu3

Copilot AI 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.

🟢 Approval recommended

The changes are cohesive and low-risk, and the remaining feedback is limited to minor robustness/performance improvements in the diagnostics helper.

Pull request overview

Improves end-user diagnosability of paste/injection failures by surfacing actionable overlay guidance and adding a one-click, on-device diagnostics report flow that pre-fills a GitHub issue and copies a richer report to the clipboard.

Changes:

  • Log the full paste-failure cause chain ({e:#}) and show cause-aware overlay text (Accessibility vs Secure Input vs other).
  • Add a Rust diagnostics module + report_bug Tauri command to gather environment/config status and a recent log tail, copy it to clipboard, and open a prefilled GitHub issue.
  • Wire the Settings ▸ Support “Report a bug” button to the new command and add the IPC constant.
File summaries
File Description
src-tauri/src/lib.rs Uses full error-chain formatting and classifies paste failures to show actionable overlay text.
src-tauri/src/diagnostics.rs New diagnostics/bug-report module (env/config snapshot, secure-input detection, log tail, URL builder).
src-tauri/src/commands.rs Adds report_bug command to copy diagnostics to clipboard and open a prefilled GitHub issue.
frontend/settings.js Calls report_bug and confirms to the user that diagnostics were copied and an issue was opened.
frontend/settings.html Updates Support UI copy/button to “Report a bug” and explains what is collected.
frontend/constants.js Adds CMD.REPORT_BUG IPC constant.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src-tauri/src/diagnostics.rs Outdated
c.refine_modifier.clone(),
)
})
.unwrap_or_default();
Comment thread src-tauri/src/diagnostics.rs Outdated
Comment on lines +241 to +248
match std::fs::read_to_string(&path) {
Ok(s) => {
let lines: Vec<&str> = s.lines().collect();
let start = lines.len().saturating_sub(max_lines);
lines[start..].join("\n")
}
Err(e) => format!("(could not read {}: {e})", path.display()),
}
- gather(): fall back to explicit "unknown" on config lock poison instead
  of empty strings, so the report never shows a blank "STT model: " line
  (matches the documented behavior).
- log_tail(): stream the log through a bounded ring buffer instead of
  reading the whole file + collecting every line, capping memory/time on a
  long-running session.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhiLhbjf14q4Qc6Cq2Kzu3
@letsgetrusty
letsgetrusty merged commit 54f0746 into main Sep 2, 2026
2 checks passed
@letsgetrusty
letsgetrusty deleted the feat/diagnostics-bug-report branch September 2, 2026 12:34
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.

2 participants