Skip to content

fix: add chat session load error diagnostics#917

Merged
simple-agent-manager[bot] merged 3 commits intomainfrom
sam/chat-error-diagnostics
May 6, 2026
Merged

fix: add chat session load error diagnostics#917
simple-agent-manager[bot] merged 3 commits intomainfrom
sam/chat-error-diagnostics

Conversation

@simple-agent-manager
Copy link
Copy Markdown
Contributor

Summary

  • Wraps getSession() and getMessages() calls in the chat session detail route with try/catch blocks
  • Logs full error details (name, message, stack) via structured logging
  • Persists errors to the observability database (platform_errors table) for /admin/errors visibility
  • Returns diagnostic details (stack trace, error name/message) to admin users while showing generic error to regular users
  • Includes a requestId for correlation across logs
  • Adds context column to persistError for searchable structured metadata
  • Adds deployment troubleshooting docs for chat session errors

Context

The "internal server error" when loading chat sessions has been recurring but the root cause is unknown because the error was being swallowed without logging. This PR adds the instrumentation needed to capture the actual error the next time it occurs.

Cherry-picked from the investigating agent's branch sam/keep-running-errors-where-01kqxn (task 01KQXN5Q8TWAGRZJ5YVRR29FH2), cleaned up to remove unrelated auto-delete TTL changes that were already merged in PR #916.

Test plan

  • Typecheck passes
  • 105 related unit tests pass (chat-session-agent-routing, observability, row-schemas)
  • CI green
  • Deploy to production via merge to main

Agent Preflight

  • Change class: cross-component-change
  • Impact: API error handling only — no behavior change for successful requests
  • Constitution: no hardcoded values, requestId generated dynamically

🤖 Generated with Claude Code

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@simple-agent-manager simple-agent-manager Bot merged commit 5d439e3 into main May 6, 2026
18 of 19 checks passed
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