Skip to content

Handle missing plan files and ship tRPC errors to Sentry#69

Merged
aletc1 merged 1 commit intomainfrom
elegant-flea-ad8f5b
May 5, 2026
Merged

Handle missing plan files and ship tRPC errors to Sentry#69
aletc1 merged 1 commit intomainfrom
elegant-flea-ad8f5b

Conversation

@aletc1
Copy link
Copy Markdown
Contributor

@aletc1 aletc1 commented May 5, 2026

Summary

  • Plan readers now use files.readTextFile and treat not-found as a normal "No plan yet" empty state, and files.readFile no longer console.errors before rethrowing.
  • The main-process tRPC errorFormatter routes thrown errors through Sentry via a new reportTrpcError helper that skips client-caused codes (BAD_REQUEST, NOT_FOUND, etc.) and sanitizes input via a shared redactUnknown exported from analytics.ts.
  • Added a focused Vitest suite covering the capture filter, sanitization, and cause-preference behavior.

Test plan

  • bun run test -- src/main/lib/trpc/index.test.ts
  • Manual: start a plan-mode chat in dev and confirm no [files] Error reading file … ENOENT line in the main-process console; sidebar shows "No plan yet" until the agent writes one.
  • Manual: throw a test error from a tRPC procedure and confirm it ships to Sentry; throw a TRPCError({ code: 'NOT_FOUND' }) and confirm it does not.

🤖 Generated with Claude Code

Replaces overly aggressive error logging with graceful error handling that distinguishes between unexpected failures and expected conditions (like unwritten plan files). Removes the Session Inspector dev-only panel from the chat interface. Adds tRPC error reporting with redaction support and refactors plan file reading to use a Result-based API that signals file availability without throwing. These changes reduce noise in error logs while improving observability for real problems.
@aletc1 aletc1 merged commit 05d1e45 into main May 5, 2026
1 check passed
@aletc1 aletc1 deleted the elegant-flea-ad8f5b branch May 5, 2026 20:14
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.

1 participant