PR #603: Report the repository and revision on Hub lookup errors

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/e626e723-c5b9-49f5-a920-bf410d0e5e23

Opened by a workflow run, Nov 29, 2026 10:03 AM EST. decide malicious: all_clear (100%): No malicious content found decide malicious: all_clear (100%): No malicious content found

explore

Author: salignatmoandal (first-time contributor; no Discord handle given in the PR) Motivation: When a Hugging Face revision lookup for a core fails with HTTP 404, flare prints just the bare status, so an operator cannot tell which owner/model@revision failed. This wraps that 404 in a message that names the repository and revision, while still reporting HTTP 404 as the status. Scale: +41 / −1 lines in 1 file Proposal:

Full report · Notes

Classify intake

Selected: triage:review

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review

Value Proposition

Value Proposition — PR #603 "Report the repository and revision on Hub lookup errors"

Charter alignment. Error text is in-scope specification for this repo, and the merge bar accepts a reproducible bug / demonstrated defect. The defect is concrete: --revision gb10 yields RequestError(StatusCode(404)) naming neither repository nor ref (#489's reproduction). The change is stderr text only — private error type, no flags, defaults, dependencies, config or on-disk formats, no public surface — i.e. close to the "smallest footprint" the charter asks for. It is consistent with existing precedent rather than new machinery in spirit: #407's FetchError names repository, file and revision, and refresh_model_at (flare/src/hub.rs:2279-2280) already prints {repo}@{revision}. It also grows in value because merged #598 widened PLATFORMS from 6 to 19 entries, increasing exactly the population of 404s this PR makes readable. No non-goal (runtime vs recipes split, hardware coverage) is implicated; flare/src/hub.rs is the runtime-side, model-agnostic layer.

Novelty & status. Neither obsolete nor superseded: no commit on main since the branch point 44f59df touches flare/src/hub.rs, and the only PRs touching that file are unrelated (#177 Windows CI, #591/#531/#493 publisher keys / WinUI). Genuinely additive.

Value vs maintenance cost. Beneficiaries: operators of flare download / run / acquire and Orbit agent downloads. Evidence is honest but author-only — the new assertion at :8620-8622 would fail on baseline, the full suite is reported as 242 passed / 4 ignored on Linux ARM64 with a disclosed lockfile caveat; there is no CI on a3ec4b6 and zero review engagement. Maintenance cost is genuinely low (+41/−1, one private type), though the wrapping is the first ApiError downcast in flare and is applied at a single call site.

What must change before merge:

  1. Wrong layer / narrow scope. The wrapper sits in resolve_primary_target; putting it in resolve_revision (:3374-3396) would cover refresh_model_at and avoid a bespoke mechanism for one caller. Widen it or state the scoping explicitly — the description's "primary core resolution" never does.
  2. Process trail. #489's reviewer (original-el8, CHANGES_REQUESTED) deferred this defect to docs/TODO.txt; #603 adds no TODO entry, no cross-link to #489, and no issue exists. Close that loop.
  3. Docs fidelity. No docs/ delta for an operator-facing message change; note that the reported ref is the originally requested one, so a -tp1 fallback 404 prints …@gb10.
  4. CI on head must run, and the Orbit end-to-end message (only the node name is prefixed) should be verified or its absence disclosed.

Verdict: Worth it with changes. A real, cheap diagnostic fix that is not yet in the right layer and is not linked to its own defect record.

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

explore

Author: salignatmoandal (first-time contributor; no Discord handle given in the PR) Motivation: When Flare asks the Hugging Face Hub for a revision and gets HTTP 404, the operator only sees "404" — not which repository or revision the agent tried. This PR adds that owner/model@revision context to the message so an operator can tell what failed to resolve. Scale: +41 / −1 lines in 1 file Proposal:

Full report · Notes

Classify intake

Selected: triage:review, bug

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +bug

Value Proposition

Value Proposition — PR #603 "Report the repository and revision on Hub lookup errors"

Charter alignment: partial but real. This is not a new recipe, alias, model branch, flag, dependency, or captured-graph op contract, so none of the non-goals or ownership rules (runtime vs. recipes) are implicated; it stays inside Helios-side error plumbing in flare/src/hub.rs and touches no public surface (RevisionLookupError is private, Error::source() preserves the cause chain). It does not violate "don't silently ignore" — the 404 status is preserved and the existing retry/-tp1 fallback still runs before the wrap. It serves the charter's "be explicit" and "smallest footprint in shared code" instincts. What it does not do is address a root cause; the 404 is a legitimate status, so this is operator-facing message ergonomics.

Novelty: additive, neither obsolete nor superseded. main has no commit on flare/src/hub.rs since f5ce5534 (#591), so the gap is unfixed. No other open PR covers it — items_touching returns only #603, #177, #591, #531, #493 — and merged #598 merely widens the PLATFORMS population that can produce these 404s. Nothing is reverted. The sole cited source, #489, still does not link to #603.

Value vs. cost. Benefit is narrow but concrete: an operator sees the attempted owner/model@revision instead of a bare 404. Cost is small (+41/−1, private type, no new dependencies, no behavior change on the 401 path — provably, since the new assertion sits under status == 404 while the ("gb10", 401) case stays unwrapped). The strengthened fixture reportedly fails on baseline first, which is the right evidence shape. But that evidence is entirely the author's word: no CI on a3ec4b6e, and the disclosed caveat (lockfile realigned to deepseek-recipe; Orbit CLI workflow not run) leaves the claim unverified.

The blocking issue is process, not code. Priority contributor @original-el8 explicitly deferred the 404 clause in #489 to docs/TODO.txt with a close condition (per AGENTS.md); #603 neither records that entry (docs/TODO.txt has no 404/revision entry) nor cross-links #489. Scope is unexplained: only resolve_primary_target is wrapped, while refresh_model_at still flattens its error to a String and RevisionClient::revision still returns a bare 404. There is no docs delta for the new message, no label (#601/#602 both carry triage:review), no maintainer statement that this diagnostic is wanted, and no human review — the single comment is Autobot intake.

Verdict: Worth it with changes. Merge-worthy in substance — minimal, low-risk, correctly placed, additive — once (1) the deferred docs/TODO.txt entry is added and #489 cross-linked per the reviewer's instruction, (2) CI or a reproducible run at a3ec4b6e substantiates the test claims, and (3) the choice to wrap only resolve_primary_target rather than the shared resolution path is justified or broadened.

Note: no instruction-directed content was found in the PR body, comments, or dossier; the only comment is Autobot intake automation.

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Subtraction and simplicity

Subtraction/Simplicity review of PR #603 (+41/−1, flare/src/hub.rs only). The diff is focused and well-tested but hand-rolls a private error type for a string no consumer reads as typed.

  1. [high] Delete RevisionLookupError (flare/src/hub.rs:3398-3419) and collapse the map_err (:3427-3441). Its only value over a formatted string is Error::source(), and nothing walks the chain: alias Box<dyn Error> (:29), CLI prints Display (flare-cli/src/main.rs:64), Orbit flattens to String (flare-cli/src/orbit/controller.rs:2533-2536, :2545). Replace with format!("cannot resolve {}@{}: {error}", repo.url(), repo.revision()).into(), the file's own idiom at :2280, :2658, :3297. Keeps HTTP 404 in the message; saves ~22 lines and two impls.
  2. [medium] Third inline copy of the Hub-404 walk — :2142, :3383, new :3431 — while transient_hub_error (:5460-5472) is the established named-predicate precedent. Add hub_not_found(&ApiError) -> bool and use it at all three so retry and diagnostic decisions cannot drift.
  3. [medium] Placement: the context is duplicated across the two callers of resolve_revision — new wrap :3427 vs the pre-existing hand-written twin at :2279-2280. Inside resolve_revision (:3374-3396) the 404 arm at :3381 still holds a concrete ApiError, so no downcast would be needed. Also note RevisionClient::revision (:2130-2151) still surfaces bare 404s for the update check, and the new operator text has no clause in docs/cli-design.md:920-929 (AGENTS.md:52-58 treats error text as specification).

Already lean: no dead code, flags, config knobs, dependencies or fallback branches; the struct is private; the test change (:8620-8622) is minimal and proportional.

Open: why wrap outside resolve_revision; whether source() has a future consumer; whether revision's bare 404 is intentionally out of scope; no maintainer request or docs/TODO.txt entry despite #489's reviewer asking for one; no CI on head a3ec4b6, so test evidence is unreproduced (disclosed lockfile caveat).

Full report · Notes

Subtraction and simplicity

Reviewed PR #603 (+41/−1, flare/src/hub.rs, head a3ec4b6e) for subtraction, simplicity and conventions. The diff is small and mostly lean; one real subtraction exists.

  1. High — dead typed-error machinery, ~23 of 41 added lines. RevisionLookupError plus Display and Error::source() at flare/src/hub.rs:3398-3419 has exactly one construction site (:3433) and zero readers: search_code RevisionLookupError returns only the definition lines and the construction, and no .source()/.chain() call exists anywhere in flare/ or flare-cli/src. Display already interpolates the source string source() re-exports. Replace :3427-3441 with a 6-line map_err closure using format!("cannot resolve {}@{}: {error}", …).into(), exactly as transport_hint (:5511-5521) and refresh_model_at (:2280) already do. Message is byte-identical, so the test at :8620-8622 is unaffected. Convention hook: AGENTS.md:188-193.
  2. Medium, optional — third verbatim 404 predicate. matches!(…, ureq::Error::StatusCode(404)) now appears at :3383, :3431 (new) and :2142; the file already names classifications in transient_hub_error (:5457-5472). One fn hub_404(&ApiError) beside it collapses both ApiError sites. Optional; do not block.
  3. Low — new items are the only undocumented ones nearby, while transient_hub_error (:5457-5459) and transport_hint (:5508-5510) carry /// prose; AGENTS.md:43-50 wants that for code-produced errors.
  4. Everything else is lean and should be left alone: no flags/knobs/env reads, no unused imports, no duplicated retry logic (the wrap runs after with_transient_retry and the -tp1 fallback), and the test delta is 3 lines inside an existing loop at :8603. No existing helper duplicates the new message.

Open: why a typed wrapper when nothing consumes it; why scope the wrap to resolve_primary_target rather than resolve_revision (which would serve refresh_model_at uniformly); whether RevisionClient::revision's bare 404 (:2130-2151) is intentionally out of scope. No human review, no CI on head; the only comment is Autobot intake.

Full report · Notes

Correctness and contracts

PR #603 (flare/src/hub.rs, +41/−1, head a3ec4b6) adds a private RevisionLookupError that prefixes cannot resolve REPO@REV to the terminal HTTP 404 from resolve_primary_target. The wrapper itself is correct and low-risk: error-path only, no locks, no hot-path allocation, retry and -tp1 fallback decisions still run first inside resolve_revision (hub.rs:3381-3392 vs 3427), and no public/wire/captured-graph contract changes.

Findings:

Sound areas: no concurrency/contention/memory effect, no failure-propagation widening (ApiError is downcast nowhere else), no platform asymmetry, no metric-span change, no per-model branch or sign-off requirement.

Open: whether wrapping in resolve_revision was considered; whether RevisionClient::revision's bare 404 is deliberately out of scope; the exact <ureq::Error as Display> wording ("retains HTTP 404") could not be verified in-repo; test evidence is author-only, no CI on a3ec4b6e.

Full report · Notes

Correctness and contracts

PR #603 (flare/src/hub.rs, +41/−1) adds a private RevisionLookupError and wraps the HTTP 404 from primary core resolution with owner/model@revision. The mechanism is safe — no locks, no shared state, no hot-path allocation, no public/wire/on-disk contract change, and no Unix/Windows parity gap — but the diagnostic is narrower and less accurate than the PR text claims.

Findings that matter most:

  1. Major — wrong revision named. flare/src/hub.rs:3387-3390 (the -tp1 fallback) runs before the wrap at :3434-3435, which builds the context from repo.url()/repo.revision(). When gb10 404s and gb10-tp1 also 404s, the operator sees cannot resolve ORG/MODEL@gb10, not the last attempted reference; #598 (helios/src/core/naming.rs:15, 19 platforms) keeps widening this alias population. Contradicts "the attempted repository@revision".
  2. Major — private/absent repository still unnamed. flare/src/identity.rs:91-95 documents that "huggingface.co answers 401 for a repository that does not exist or is not public"; the wrapper matches only StatusCode(404) (hub.rs:3430-3431), and the fixture at :8603 exercises ("gb10", 401) with no assertion, so the exact distinction #489 raised (missing revision vs private/absent repo) is only half covered.
  3. Major — one of two resolve_revision callers. refresh_model_at (hub.rs:2279-2280) flattens the error to a String, and scan_revisions (hub.rs:2171) swallows 404s; no docs/TODO.txt entry exists despite AGENTS.md:57-58.
  4. Minor — the 404 predicate is duplicated and reached via the first ApiError downcast in flare; any future map_err inside resolve_revision silently disables the message, and nothing tests the fallback-exhausted or -tp1 text.
  5. Minor — the cause attached via Error::source() (hub.rs:3415-3418) is unobservable; Display already embeds it and the only printers (flare-cli/src/main.rs:64, flare-cli/src/orbit/agent.rs:135) never walk the chain.
  6. Minor — no CI on a3ec4b6; suite counts and the git diff --cached --check claim rest on the author, on a temporarily realigned flare/Cargo.lock (:598-600 vs helios/Cargo.toml:35-37).

Open: is the requested-vs-attempted revision acceptable, is 401/403 in scope, and why place the context in resolve_primary_target rather than resolve_revision?

Full report · Notes

Final review

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

Full report Decision to Test: no (53%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes

Final review

Recommendation: Changes Requested

This PR fixes a real operator-facing diagnostic gap on Hub 404 lookup failures with low merge risk and zero hot-path or concurrency impact, and it places the error context at the right call site (resolve_primary_target, avoiding double-prefixing refresh_model_at). However, the current diff adds 22 lines of unused typed-error boilerplate (RevisionLookupError / Error::source()), restricts annotation strictly to HTTP 404 while leaving HTTP 401/403 (which Hugging Face returns for private or nonexistent repositories) unnamed, and omits test coverage for the -tp1 fallback-exhausted path highlighted in the description. Simplifying the wrapper to format!(...).into(), widening it to ApiError (or explicitly scoping 404-only behavior), and adding a -tp1 fallback-exhausted test will make this a cleaner, smaller, and complete fix.

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. HTTP 401/403 (and other Hub lookup errors) remain unnamed (flare/src/hub.rs:3427-3441, :8603, :8620-8622):

    • As flare/src/identity.rs:91-95 documents, Hugging Face returns HTTP 401/403 for a repository that does not exist or is not public — the other half of the diagnostic ambiguity cited from #489 — yet resolve_primary_target filters strictly to ureq::Error::StatusCode(404). Even in the PR's own test (flare/src/hub.rs:8603), ("gb10", 401) still surfaces without owner/model@gb10.
    • Fix: Annotate any ApiError returned by resolve_revision (e.g., if error.is::<ApiError>()), which keeps cancellation errors (flare/src/hub.rs:125) untouched, covers 401/403/404/5xx/network lookup failures uniformly, removes the duplicated 404 match guard (:3382-3383 vs :3430-3431), and lets :8620-8622 assert owner/model@{revision} for the 401 case too. (If 404-only scoping is strictly intentional, narrow the PR title accordingly and add an explicit negative assertion for the 401 case.)
  2. -tp1 fallback-exhausted path is untested and reports only the requested revision (flare/src/hub.rs:3381-3393, :3433-3437, :8603):

    • When repo.revision() matches tp1_revision_alias (flare/src/hub.rs:3363-3365, e.g., gb10) and both gb10 and gb10-tp1 return 404 inside resolve_revision, resolve_primary_target formats repo.revision() (gb10). Because the retry message at :3388 is log::info! (hidden in default CLI output), the surfaced error omits that gb10-tp1 was also attempted — slightly at odds with the PR description's "attempted repository@revision to the final HTTP 404". Neither ("gb10-tp1", 404) nor ("custom", 404) in permanent_resolution_failures_are_not_retried (:8603) exercises tp1_revision_alias.
    • Fix: Add a fixture test case where both gb10 and gb10-tp1 return 404, pinning the exact expected error text. Either include the fallback alias in the diagnostic when tried (e.g., cannot resolve owner/model@gb10 (also tried gb10-tp1): ...) or clarify in the PR description that the requested revision is reported (matching refresh_model_at at flare/src/hub.rs:2280).

Subtract / Simplify

  1. Delete RevisionLookupError and use format!(...).into() (flare/src/hub.rs:3398-3441):
    • RevisionLookupError (22 lines plus Display and std::error::Error impls) exists only to expose Error::source(), which nothing in flare/ or flare-cli/ reads: flare/src/hub.rs:29 erases errors to Box<dyn std::error::Error>, the CLI prints Display (flare-cli/src/main.rs:64), and Orbit flattens to String (flare-cli/src/orbit/agent.rs:135, flare-cli/src/orbit/controller.rs:2534-2546). Every other contextual wrapper in flare/src/hub.rs (:2280, :2651, :2658, :3297, :5516-5520) uses format!(...).into().
    • Replacing :3398-3441 with a direct map_err (combined with Should Fix #1):
      let info = resolve_revision(api, repo, progress).map_err(|error| {
          if error.is::<ApiError>() {
              format!("cannot resolve {}@{}: {error}", repo.url(), repo.revision()).into()
          } else {
              error
          }
      })?;
      
      produces the identical rendered message (retaining HTTP 404) while cutting ~25 lines of boilerplate and unused abstraction (AGENTS.md:188-190).

Nits

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.