Repository navigation
fix(llm): record breaker health on every task path - #313
Merged
Merged
Conversation
The /system/llm/ badge read llm_profile_health, which only the failover Pool wrote. A task pinned to an explicit chain, a bound agent with failover off, and the global provider all call the provider directly, so a dead backend stayed "Healthy". One policy now lives in llmpool.Registry.RecordCall, used by the Pool and by the task runtimes: a success clears the state, a failover-eligible failure trips it, context cancellation and deterministic 400s do not, and a stream that already delivered output is left alone. The selection carries the profile whose breaker the call updates, and a provider already wrapped in the Pool reports nothing to avoid double counting. The LLM recording page also explains an empty list while the llm_record toggle is off, after the settings call resolves. Originally reported in #257.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
/system/llm/badge readllm_profile_health, which only the failover Pool wrote. Three task paths call the provider directly and never reported anything:providerForProfile),So a dead backend stayed
Healthy, including on a single-profile install.This replaces the report in #257 with a clean implementation. The policy lives once in
llmpool.Registry.RecordCall, and the Pool uses it too, so a profile's state no longer depends on which path the request took:The selection carries
healthProfileID(separate fromprofileID, which keeps its chain semantics), and a provider already wrapped in the Pool reports nothing, so nothing is counted twice. Every physical attempt is reported, retries included.The LLM recording page also stops looking broken when the toggle is off: the empty state explains it once the settings call has resolved, without flashing the wrong copy.
Tests cover the policy (
llmpool/health_record_test.go) and the wiring (server/task_llm_health_test.go): success, atomic 400, stream 400, cancel, committed stream failure, a retried pre-commit failure per attempt, pool parity, and thehealthProfileID 0no-op.Credit for the report: @aminasoussi1986-creator in #257.