Repository navigation
feat(catalog): expose HTTP status on listing errors - #28
Merged
Merged
Conversation
Add tests asserting that list_models and OpenRouter key validation surface the actual HTTP status on failure, and that no status is reported for error payloads, malformed JSON, or connection failures. This guards against error messages that mention a status unrelated to the real response. Auto-committed-on: dragonfly
The error type now carries an optional HTTP status alongside its message, set only when the failure came from a non-success response. This lets callers distinguish provider HTTP failures from request or parsing errors without parsing the message text. Auto-committed-on: dragonfly
Reformatted the construction of ListModelsError values so the format! arguments and the status code are passed as separate, consistently indented arguments. No behaviour change. Auto-committed-on: dragonfly
Annotate the ListModelsError::http_status getter with #[must_use] so callers are warned when they discard the returned status without acting on it. Auto-committed-on: dragonfly
This was referenced Oct 19, 2026
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.
Expose the actual HTTP status on
ListModelsErrorso callers can classify rejected catalog requests without parsing display text. Status metadata is attached only to non-success HTTP responses from model listing and OpenRouter key validation; transport, parsing, and provider-payload errors retainNone. Existing display messages, including the 404 recovery guidance, remain unchanged.Validation:
cargo fmt --all -- --check;cargo check -p tinyinference-llm;cargo clippy -p tinyinference-llm --all-targets -- -D warnings;cargo test -p tinyinference-llm(794 unit tests, 9 integration tests, 2 doctests). Parent verification reran all eight catalog-fetch tests at the final head; all passed.This is a TinyInference capability prerequisite for the existing OpenHuman adoption leaf. The host adoption remains pending.
Refs senamakel/openhuman#258
Part of tinyhumansai/openhuman#8092