Agent chat hang feedback + Sentry error reporting#91
Merged
Conversation
The agent chat panel showed only bouncing dots with no indication of what was happening or any way out if the Gemini call ran long. Now the loading indicator escalates through "thinking" -> "still working" -> "taking longer than usual" messages based on elapsed time, exposes a cancel button after 8s, and both client (60s) and server (55s) enforce hard timeouts so a stuck request always resolves with a clear message instead of hanging indefinitely. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FSWUNtUJkZ2p7ciNoNCKLH
…ontend console.error/warn calls were the only error signal (see the earlier AI-logs discussion), invisible once they scroll off Cloud Run/DigitalOcean's log buffer. Sentry now captures them automatically via captureConsoleIntegration on both sides, plus richer tagged captures for the two Gemini-backed endpoints (agent chat, suggest-articles) that were the original ask. Backend init lives in instrument.ts, preloaded via `--import` (tsx/Node --import flag) rather than called from server.ts's own body — under ESM, server.ts's imports (express included) are all resolved before any of its top-level code runs, so Sentry.init() from inside server.ts is always too late for the Express auto-instrumentation to patch express at import time. Fully opt-in: unset SENTRY_DSN / VITE_SENTRY_DSN (both added to .env.example) disables reporting entirely, matching local dev today. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FSWUNtUJkZ2p7ciNoNCKLH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@sentry/node, frontend via@sentry/react) so failures — especially in the two Gemini-backed endpoints (agent chat, suggest-articles) — are actually visible after the fact, instead of only existing asconsole.errorlines that scroll off the DigitalOcean log buffer. Fully opt-in viaSENTRY_DSN/VITE_SENTRY_DSN; no-ops with those unset.Test plan
npm run lint(tsc --noEmit) passes cleantsx --import ./instrument.ts server.tsand a test Sentry DSN, confirming the Express auto-instrumentation warning is resolved--importpreload ordering fix against a throwing Express route to confirmsetupExpressErrorHandlerattaches correctly🤖 Generated with Claude Code
https://claude.ai/code/session_01FSWUNtUJkZ2p7ciNoNCKLH
Generated by Claude Code