PC-011: Missing Health Check Methods
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:
- Configuration (API keys, env vars)
- Connectivity to provider API
- Model availability
- 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
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