Final review report · NVIDIA/hyperflare-inference #603

Raw Markdown for agents: https://autobot.eidonix.com/p/d30e3c48-058c-4194-89ea-e3699313ce6e.md

Recommendation: Ready To Merge

PR #603 is a small, correct, low-risk diagnostic fix that adds the attempted repository@revision to terminal HTTP 404 errors in resolve_primary_target (flare/src/hub.rs:3427-3441), directly addressing the bare-404 gap reported in #489 without altering retry or -tp1 fallback behavior. No correctness, safety, concurrency, or contract blockers were found. Before or alongside merge, the diff can be simplified by deleting the unused private RevisionLookupError type in favor of format!(...).into(), and test coverage should add the double-404 -tp1 fallback case (gb10 + gb10-tp1 both 404).

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. Cover the -tp1 alias double-404 path in tests (flare/src/hub.rs:8601-8625). permanent_resolution_failures_are_not_retried tests [("gb10", 401), ("gb10-tp1", 404), ("custom", 404)]. Because "gb10-tp1" is not in PLATFORMS (helios/src/core/naming.rs:15-18), tp1_revision_alias("gb10-tp1") (flare/src/hub.rs:3363-3365) returns false — neither 404 iteration exercises the gb10 → gb10-tp1 fallback before failing, which is the exact #489 scenario (--revision gb10 against a main-only repo) and is explicitly called out in the PR description. (Meanwhile blackwell_revision_alias_installs_and_refreshes_the_pinned_core at :12631 only tests gb10 404 → gb10-tp1 200.)
    • Concrete fix: Add a unit test (or case) where repo requests "gb10" and both /api/models/owner/model/revision/gb10 and /api/models/owner/model/revision/gb10-tp1 return 404, asserting each route was requested once and the final error contains owner/model@gb10 and 404.

Subtract / Simplify

  1. Delete RevisionLookupError and format inline in map_err (flare/src/hub.rs:3398-3441). RevisionLookupError (:3398-3419) is private, constructed at a single line (:3433), never downcast anywhere, and nothing in flare/ or flare-cli/ calls .source() on returned errors (every boundary stringifies via Display, e.g. flare-cli/src/main.rs:64, flare-cli/src/orbit/agent.rs:135, flare/src/controller.rs:1308). Additionally, interpolating {self.source} inside Display while also returning Some(self.source.as_ref()) from Error::source() will double-print the underlying error if any future caller walks the error chain. Replacing the 22-line struct with the file's existing format!(...).into() idiom (matching refresh_model_at at :2279-2280 and transport_hint at :5511-5521) produces identical output in ~8 lines:
    fn is_hub_not_found(error: &ApiError) -> bool {
        matches!(
            error,
            ApiError::RequestError(request)
                if matches!(request.as_ref(), ureq::Error::StatusCode(404))
        )
    }
    
    Then reuse is_hub_not_found at :3382-3384 (Err(error) if is_hub_not_found(&error) && tp1_revision_alias(revision) =>) and simplify :3427-3441 to:
    let info = resolve_revision(api, repo, progress).map_err(|source| {
        if source.downcast_ref::<ApiError>().is_some_and(is_hub_not_found) {
            format!("cannot resolve {}@{}: {source}", repo.url(), repo.revision()).into()
        } else {
            source
        }
    })?;
    

Nits

None.

Dropped on verification