Skip to content

Agent error messages expose raw technical details to users #1319

@graycyrus

Description

@graycyrus

Bug

When an agent job fails, the raw technical error message is shown directly in the chat UI:

agent job failed: error sending request for url (https://staging-api.alphahuman.xyz/openai/v1/chat/completions)

Expected behavior

  • Technical error details (URLs, stack traces, internal service names) should never be shown to end users in the chat.
  • Errors should be reported to Sentry automatically with full context (URL, status code, request ID, etc.).
  • The chat should show a user-friendly message like:
    • "Something went wrong. Please try again."
    • "This error has been reported. You can also report it on Discord."
    • Include a "Report on Discord" link/button.

Current behavior

Raw error strings including internal API URLs are displayed verbatim in the chat bubble.

Why this matters

  1. UX: Technical jargon is confusing and unhelpful for users.
  2. Security: Leaking internal API URLs and infrastructure details is an unnecessary exposure.
  3. Observability: Without Sentry capture, these errors are invisible to the team unless a user reports them manually.

Suggested approach

  • In the agent execution path, catch errors and:
    1. Log/report to Sentry with full technical context.
    2. Surface a sanitized, user-friendly message in the chat.
  • Consider a generic error boundary for all agent job results that strips technical details.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions