Repository navigation
fix: name the provider, endpoint, model and status of a failed model call - #236
Merged
Merged
Conversation
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.
Closes #234
Status Code: NotFoundvsHTTP 404 (...)) and neither names the address; read here, they come out the same and no provider exception type is named.FailureDescribingChatClientwraps the provider client in the composition root, the one place that knows provider, endpoint and model. The domain still sees an exception with a message, soReleaseChangelogGeneratoris unchanged.<provider> at <address> answered <status> for model '<model>'., then what the status usually means, thenThe endpoint said: .... The address is the one requested, which shows a doubled or missing/v1; query and user info are left out, since some providers take a key there.404: the model id is not served (check llm.model), orChartula__Llm__BaseUrlis not this provider's API. Without a base URL only the model is named - the endpoint is the provider's own.401/403: names the key variable; a401with the variable unset (possible withopenai-compatible) says so.Connection refused (...)), not the SDK'sI/O exceptionaround it.The same as Technical.under the rest. Continuation lines are indented under their audience instead of starting flush left.faithfulness.modelset to a model the endpoint does not serve, the check's call threw out of the pipeline as an unhandled exception with a stack trace and a core dump, and the renderings were lost. It is nowNotEvaluatedwith the same explanation, namingfaithfulness.model; the rendering is kept and flagged, as for an unreadable verdict. Cancellation still propagates.LlmServiceCollectionExtensions.cli.md(When a model call fails),configuration.md(the401sentence).Reproduced before the fix with the release binary against a local stub (
Chartula__Llm__BaseUrlpointed at it, dummy keys), both providers:and with the stub answering 404 only for the check's model:
Verified after the fix, same commands:
Also checked: openai-compatible 404 and anthropic 401, a 401 with
OPENAI_API_KEYunset (The endpoint needs a key, and OPENAI_API_KEY is not set.), and a refused connection for both providers.Tests:
ModelCallFailureTests(through the real Anthropic and OpenAI adapters with only the network stubbed: 404 with and without a base URL, 401, 401 without a key, 403, the check's own model, an empty body, an unreachable endpoint),ReleaseCommandOutputTests(same reason said once, different reasons each, indentation),ThoroughFaithfulnessCheckerTests(a failed call is not evaluated, cancellation propagates); full suite 751 passing, build anddotnet formatclean.