[PR #5400] feat(provider): add health check infrastructure #11382

Closed
opened 2026-02-16 18:16:12 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5400

State: closed
Merged: No


When using local providers like LM Studio, users often get generic connection errors that don't help diagnose the problem. This adds optional health check infrastructure so providers can validate their connection before SDK initialization.

The health check runs lazily when the SDK is first requested, and results are cached to avoid repeated checks. For local providers (127.0.0.1 or localhost), health checks are automatically enabled. You can also configure them explicitly for any provider.

If a health check fails, it logs a warning but doesn't prevent SDK creation - this keeps things non-blocking. The health check uses a simple HTTP request to a configurable endpoint (defaults to baseURL + /models) with a timeout.

This is the foundation for better error messages and connection validation, especially useful for local providers where the server might not be running.

Related issues: #1555, #2205, #4255, #508

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5400 **State:** closed **Merged:** No --- When using local providers like LM Studio, users often get generic connection errors that don't help diagnose the problem. This adds optional health check infrastructure so providers can validate their connection before SDK initialization. The health check runs lazily when the SDK is first requested, and results are cached to avoid repeated checks. For local providers (127.0.0.1 or localhost), health checks are automatically enabled. You can also configure them explicitly for any provider. If a health check fails, it logs a warning but doesn't prevent SDK creation - this keeps things non-blocking. The health check uses a simple HTTP request to a configurable endpoint (defaults to baseURL + /models) with a timeout. This is the foundation for better error messages and connection validation, especially useful for local providers where the server might not be running. Related issues: #1555, #2205, #4255, #508
yindo added the pull-request label 2026-02-16 18:16:12 -05:00
yindo closed this issue 2026-02-16 18:16:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11382