Skip to content

Conversation

@felarof99
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the fix label Jan 27, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

Added detection for MCP server connection failures to show user-friendly error messages with a link to troubleshooting documentation when the agent cannot connect to 127.0.0.1.

Key changes:

  • Added isConnectionError flag to detect fetch failures to localhost
  • Created getTitle() helper to manage error titles based on error type
  • Added troubleshooting guide link for connection errors
  • Improved error UX by directing users to documentation when the MCP server is unreachable

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-contained, follow existing error handling patterns, add helpful user-facing documentation links, and maintain code quality. The logic is straightforward with proper fallback behavior.
  • No files require special attention

Important Files Changed

Filename Overview
apps/agent/entrypoints/sidepanel/index/ChatError.tsx Added MCP server connection error detection with troubleshooting link, refactored title logic into helper function

Sequence Diagram

sequenceDiagram
    participant User
    participant Chat
    participant ChatError
    participant parseErrorMessage
    participant Browser

    User->>Chat: Sends message
    Chat->>MCP Server: Attempts connection to 127.0.0.1
    MCP Server-->>Chat: Connection failed (fetch failed)
    Chat->>ChatError: Renders error component
    ChatError->>parseErrorMessage: Parse error.message
    parseErrorMessage->>parseErrorMessage: Detect "Failed to fetch" + "127.0.0.1"
    parseErrorMessage-->>ChatError: Return {isConnectionError: true, url, text}
    ChatError->>ChatError: getTitle() returns "Connection failed"
    ChatError->>User: Display error with troubleshooting link
    User->>Browser: Clicks "View troubleshooting guide"
    Browser->>Browser: Opens docs.browseros.com/troubleshooting/connection-issues
Loading

@claude
Copy link

claude bot commented Jan 27, 2026

Code Review - Inline Comment

File: apps/agent/entrypoints/sidepanel/index/ChatError.tsx (line 23)

The hardcoded URL 'https://docs.browseros.com/troubleshooting/connection-issues' should be moved to @browseros/shared/constants/urls to avoid magic constants scattered in the codebase.

According to the CLAUDE.md guidelines:

Avoid magic constants scattered in the codebase. Use @browseros/shared for all shared configuration:

  • @browseros/shared/constants/urls - External service URLs (EXTERNAL_URLS)

Suggested fix:

  1. Add the URL to packages/shared/src/constants/urls.ts:
export const EXTERNAL_URLS = {
  // ... existing URLs
  TROUBLESHOOTING_CONNECTION: 'https://docs.browseros.com/troubleshooting/connection-issues',
} as const
  1. Import and use it in this file:
import { EXTERNAL_URLS } from '@browseros/shared/constants/urls'

// Then use it:
url: EXTERNAL_URLS.TROUBLESHOOTING_CONNECTION,

Checked for bugs and CLAUDE.md compliance.

@felarof99 felarof99 merged commit 9cc2b02 into main Jan 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants