Skip to content

feat: Add /health command for provider connectivity testing #6

@furkankoykiran

Description

@furkankoykiran

Feature Request: Add Health Check Command (/health)

Problem Statement

Users encounter cryptic errors when API keys are invalid, providers are unreachable, or models are unavailable. There's currently no quick way to diagnose connectivity issues across multiple configured providers.

Proposed Solution

Add a /health slash command that tests connectivity to all configured providers and displays a clear status report.

Expected Output

Provider Health Status:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Anthropic    - Connected (claude-3-5-sonnet-20241022)
✗ OpenAI       - Failed: Invalid API key
✓ DeepSeek     - Connected (deepseek-chat)
✓ Google       - Connected (gemini-2.0-flash-exp)
✓ OpenRouter   - Connected (anthropic/claude-3.5-sonnet)
○ Ollama       - Not configured
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Status: 4/5 providers connected

Implementation Plan

Files to modify:

  1. cli_agent/core/mcp_host.py - Add health check methods
  2. cli_agent/core/slash_commands.py - Add /health command handler
  3. tests/test_slash_commands.py - Add comprehensive tests
  4. README.md - Update documentation

Provider support:

  • Anthropic (Claude models)
  • OpenAI (GPT models)
  • DeepSeek (Chat and reasoning models)
  • Google Gemini
  • OpenRouter (Multi-provider access)
  • Ollama (Local model inference)

Health check strategy:

  • Parallel async checks for all 6 providers
  • Clear visual output (✓ connected, ✗ failed, ○ not configured)
  • Error messages for failed connections
  • Summary statistics

Impact

  • User Experience: Quick diagnostics for API keys, network issues, and provider availability
  • Complexity: Low (1-2 files modified, clean implementation)
  • Visibility: High (new slash command in help)
  • Testing: Comprehensive test coverage included

Reference Implementation

I have prepared a complete implementation with:

  • ✅ All 4 files modified with proper code
  • ✅ 4 commits following project convention
  • ✅ Comprehensive test coverage
  • ✅ Documentation updated

Ready to submit as PR. Implementation branch available for review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions