Class LLMHealthcheckValidator
java.lang.Object
com.tnsai.agents.validation.validators.LLMHealthcheckValidator
- All Implemented Interfaces:
ReachabilityValidator,Validator
AGENT-V005 — opt-in reachability probe for the configured
LLMClient.
Runs only when AgentBuilder.withReachabilityChecks(true) is
set. Surfaces the all-too-common situation where the agent builds
fine but the very first chat call hits an unreachable provider /
wrong API key / rate-limited account — symptoms that today only
appear minutes into production.
Behaviour matrix
| State | Outcome |
|---|---|
| No LLM configured | Silent (V002 owns the missing-LLM signal) |
LLM does not implement Healthcheckable |
Silent — the provider has not opted into probeability and the framework can't synthesise a meaningful probe (a chat call costs money / a list-models call returns empty by default) |
Probe returns reachable=true |
Silent |
Probe returns reachable=false |
WARNING with provider-supplied error message + observed latency in the structured context |
Probe throws (contract violation — implementations must
convert failures to unreachable) |
WARNING with the throwable's message; never propagates the exception out of validation |
Severity is WARNING, not ERROR — networks are transient and the
user has explicitly asked for the probe; failing the build outright
on a momentary blip would be hostile. Suppress with
.relaxValidation("AGENT-V005") for environments where the
probe-time provider is genuinely different from the runtime provider.
- Since:
- 0.8.4 (issue #85 phase 2a)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionid()Short, stable id for logging and test assertions (e.g.Inspect the agent configuration and return any issues detected.
-
Constructor Details
-
LLMHealthcheckValidator
public LLMHealthcheckValidator()
-
-
Method Details
-
id
Description copied from interface:ValidatorShort, stable id for logging and test assertions (e.g."llm-presence"). -
validate
Description copied from interface:ValidatorInspect the agent configuration and return any issues detected. Returning an empty list means "no problems found by this validator".
-