neurolink icon indicating copy to clipboard operation
neurolink copied to clipboard

PC-011: Missing Health Check Methods

Open murdore opened this issue 1 month ago • 0 comments

Bug Summary

No health check mechanism exists. Errors surface during API calls instead of early validation.

Root Cause

File: src/lib/core/baseProvider.ts No checkHealth() method. Providers don't validate config/connectivity on init.

Affected Providers

All providers

Current Behavior

  • Invalid API key: Constructor succeeds, error on first API call
  • Network issues: Constructor succeeds, error on first API call
  • Invalid model: Constructor succeeds, error on first API call
  • No proactive health check

Expected Behavior

Health check method that validates:

  1. Configuration (API keys, env vars)
  2. Connectivity to provider API
  3. Model availability
  4. Returns structured health status

Implementation

```typescript export interface ProviderHealthStatus { healthy: boolean; provider: string; checks: { config: { passed: boolean; message?: string }; connectivity: { passed: boolean; message?: string }; modelAvailable: { passed: boolean; message?: string }; }; }

abstract class BaseProvider { async checkHealth(): Promise<ProviderHealthStatus>; protected abstract validateConfig(): Promise; protected abstract testConnectivity(): Promise; protected abstract verifyModelAvailability(): Promise; } ```

CLI command: ```bash neurolink health-check --provider openai ```

Acceptance Criteria

  • checkHealth() in BaseProvider
  • All providers implement it
  • Validates config, connectivity, model
  • CLI command created
  • Tests pass
  • Documentation updated

Priority

Medium - Improves debugging experience

Effort

4 hours

murdore avatar Dec 01 '25 02:12 murdore