fix(health): llama probe also covers the managed [[models]] path (A§4)
64a90e7 gated the probe on a static [[providers]] llamacpp url, missing the primary
managed path (sample-config.toml's [[models]], where correx spawns llama-server at
[models].host:port and registers no provider entry). Fall back to that host:port when
[[models]] is configured so the LLAMA_SERVER subject is monitored on the common setup.
Surfaced while drafting the A§4 live-QA plan. Compile green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -441,10 +441,15 @@ fun main() {
|
|||||||
val seeded = DefaultEventReplayer(eventStore, com.correx.apps.server.health.HealthProjection())
|
val seeded = DefaultEventReplayer(eventStore, com.correx.apps.server.health.HealthProjection())
|
||||||
.rebuild(com.correx.apps.server.health.SYSTEM_SESSION)
|
.rebuild(com.correx.apps.server.health.SYSTEM_SESSION)
|
||||||
.subjects.mapValues { it.value.status }
|
.subjects.mapValues { it.value.status }
|
||||||
// Monitor the llama server only when a llamacpp provider URL is configured — otherwise the
|
// Monitor the llama server only when one is configured — otherwise the LLAMA_SERVER subject
|
||||||
// LLAMA_SERVER subject would report a spurious DEGRADED on a box that runs no local model.
|
// would report a spurious DEGRADED on a box that runs no local model. Covers BOTH paths: an
|
||||||
|
// explicit static [[providers]] url, or the managed [[models]] server at [models].host:port.
|
||||||
// A dedicated short-timeout client keeps a hung server from stalling the probe loop.
|
// A dedicated short-timeout client keeps a hung server from stalling the probe loop.
|
||||||
val llamaProbe = correxConfig.providers.firstOrNull { it.type == "llamacpp" }?.url?.let { url ->
|
val llamaUrl = correxConfig.providers.firstOrNull { it.type == "llamacpp" }?.url
|
||||||
|
?: correxConfig.models.firstOrNull()?.let {
|
||||||
|
"http://${correxConfig.modelsSettings.host}:${correxConfig.modelsSettings.port}"
|
||||||
|
}
|
||||||
|
val llamaProbe = llamaUrl?.let { url ->
|
||||||
val healthHttpClient = io.ktor.client.HttpClient(io.ktor.client.engine.cio.CIO) {
|
val healthHttpClient = io.ktor.client.HttpClient(io.ktor.client.engine.cio.CIO) {
|
||||||
engine { requestTimeout = LLAMA_HEALTH_TIMEOUT_MS }
|
engine { requestTimeout = LLAMA_HEALTH_TIMEOUT_MS }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user