mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The Local provider speaks the standard JSON wire: response_format by default, one self-healing fallback per endpoint when a server rejects it (dialect cached per base URL) — LiteLLM, OpenRouter, vLLM, LM Studio and plain Ollama all work from the same form, and the form + provider docs now say so. A gateway that shims a Claude-family model behind a synthesized tool call is parsed from the tool-call arguments instead of yielding silently empty insights. The insight token budget is configurable (INSIGHTS_MAX_TOKENS, default 2500, clamped 500-8000) and unified across all six call sites; a reply cut off mid-JSON returns a distinct truncation error instead of a generic parse failure. A briefing withheld by the number-grounding check now says so on the card instead of pretending nothing was generated. The provider test button answers 4xx with a bad_request category instead of claiming the endpoint was unreachable. Sleep repair follow-up: measurements carries a second full unique index — the natural key (type, measured_at, source, sleep_stage) — so a key-format migration could tombstone the old rows while their re-keyed replacements collided with that index and were silently dropped (live incident: a full-history re-sync erased a user's sleep). Planned creates now run a natural-key rescue probe: a match, live or tombstoned, is updated in place — fresh value, the new externalId, deletedAt cleared. A rescue-probe failure holds the watermark so nothing is lost past the overlap.