Health: learn n_ctx and total_slots from /props

Implemented /props learning in internal/health/health.go (added Status.NCtx/Status.Slots, PerSlotCtx, and a best-effort GET <base>/props appended to the poll after /v1/models; 0/unknown on any failure without failing the poll) and exposed them in internal/admin/admin.go HostView. Copied internal/health/props_test.go and the replacement internal/proxy/helpers_test.go byte-identical to docs/plans/v2/_files/.

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-25 09:14:08 -07:00
parent f73ffb0d27
commit 056a527fd7
5 changed files with 154 additions and 3 deletions
+4
View File
@@ -38,6 +38,8 @@ type HostView struct {
InFlight int `json:"in_flight"` // sum over the host's configured models
Queued int `json:"queued"` // same
Draining bool `json:"draining"`
NCtx int `json:"n_ctx"` // from /props; 0 = unknown
Slots int `json:"slots"` // from /props; 0 = unknown
}
// LeaseView is one lease's row in a route's leases.
@@ -125,6 +127,8 @@ func (hx *handler) hostView(name string, s health.Status) HostView {
InFlight: inflight,
Queued: queued,
Draining: hx.d.Draining(name),
NCtx: s.NCtx,
Slots: s.Slots,
}
}