Skip to content

feat(catalog): expose HTTP status on listing errors - #28

Merged
senamakel merged 4 commits into
epic/8092-inference-outfrom
epic-8092-258-catalog-status
Oct 19, 2026
Merged

senamakel merged 4 commits into
epic/8092-inference-outfrom
epic-8092-258-catalog-status

Conversation

@senamakel

@senamakel senamakel commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Expose the actual HTTP status on ListModelsError so 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 retain None. 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant