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
- Isolated error-path change: Confined to a single
.map_erron the terminal HTTP 404 path ofresolve_primary_target(flare/src/hub.rs:3427-3441), off the serving, CUDA-graph, and token-generation hot paths. - No control-flow or contract impact:
resolve_revision's transient retry (with_transient_retry,flare/src/hub.rs:5476-5493) and-tp1alias fallback (flare/src/hub.rs:3382-3391) still execute before wrapping; non-404 errors pass through unchanged, and no downstream caller downcastsApiErroror inspects.source()(onlyPublisherKeyRequiredis downcast inflare/src/controller.rs:1306andflare-cli/src/hub.rs:66, 75, 139). - No concurrency, I/O, or memory regression: No locks, shared state, or
AcquisitionProgresscounters are touched; zero allocations occur on the success path, and only shortStringformatting occurs on a failing 404 lookup.
Walkthrough
flare/src/hub.rs:3398-3419: Adds privateRevisionLookupErrorwrappingrepository,revision, andsource: Box<dyn std::error::Error>withDisplay(cannot resolve {repository}@{revision}: {source}) andError::source().flare/src/hub.rs:3427-3441: Wraps terminalApiError::RequestError(ureq::Error::StatusCode(404))errors returned byresolve_revisioninsideresolve_primary_target(which servesdownload_for_model_atat:434,acquire_updatevia:13955, Orbit'sdownload_watched, and testfetch_primary_with_progressat:3480), leaving non-404 errors untouched.flare/src/hub.rs:8620-8622: Extendspermanent_resolution_failures_are_not_retriedto assertowner/model@{revision}is present in the formatted error whenstatus == 404.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure error-text formatting on
repo.url()andrepo.revision(); no tokens, headers, or credentials are interpolated, and no prompt-injection or suspicious instructions appear in the PR or diff. - [PASS] Charter & value fit: Minimal, model-agnostic operator diagnostic fix in the right layer (
flare/src/hub.rs) for a concrete bug surfaced in #489; no new flags, dependencies, or public API surface. - [PASS] Related / duplicate / conflict check: No conflicting or duplicate open PRs; complements #598's expanded
PLATFORMSlist andf5ce5534(#591)'sacquire_updateflow (flare/src/hub.rs:13941-13969). - [WARN] Tests & verification evidence: Author reports passing release-mode
flaretests on Linux ARM64 (242 passed, 4 ignored) with a local-only lockfile alignment fordeepseek-recipeand no full Orbit CLI run; no automated CI check run is attached toa3ec4b6, and the-tp1double-404 fallback path lacks a unit test (see Should Fix).
Blockers
None.
Should Fix
- Cover the
-tp1alias double-404 path in tests (flare/src/hub.rs:8601-8625).permanent_resolution_failures_are_not_retriedtests[("gb10", 401), ("gb10-tp1", 404), ("custom", 404)]. Because"gb10-tp1"is not inPLATFORMS(helios/src/core/naming.rs:15-18),tp1_revision_alias("gb10-tp1")(flare/src/hub.rs:3363-3365) returnsfalse— neither 404 iteration exercises thegb10→gb10-tp1fallback before failing, which is the exact#489scenario (--revision gb10against amain-only repo) and is explicitly called out in the PR description. (Meanwhileblackwell_revision_alias_installs_and_refreshes_the_pinned_coreat:12631only testsgb10404 →gb10-tp1200.)- Concrete fix: Add a unit test (or case) where
reporequests"gb10"and both/api/models/owner/model/revision/gb10and/api/models/owner/model/revision/gb10-tp1return 404, asserting each route was requested once and the final error containsowner/model@gb10and404.
- Concrete fix: Add a unit test (or case) where
Subtract / Simplify
- Delete
RevisionLookupErrorand format inline inmap_err(flare/src/hub.rs:3398-3441).RevisionLookupError(:3398-3419) is private, constructed at a single line (:3433), never downcast anywhere, and nothing inflare/orflare-cli/calls.source()on returned errors (every boundary stringifies viaDisplay, e.g.flare-cli/src/main.rs:64,flare-cli/src/orbit/agent.rs:135,flare/src/controller.rs:1308). Additionally, interpolating{self.source}insideDisplaywhile also returningSome(self.source.as_ref())fromError::source()will double-print the underlying error if any future caller walks the error chain. Replacing the 22-line struct with the file's existingformat!(...).into()idiom (matchingrefresh_model_atat:2279-2280andtransport_hintat:5511-5521) produces identical output in ~8 lines:
Then reusefn is_hub_not_found(error: &ApiError) -> bool { matches!( error, ApiError::RequestError(request) if matches!(request.as_ref(), ureq::Error::StatusCode(404)) ) }is_hub_not_foundat:3382-3384(Err(error) if is_hub_not_found(&error) && tp1_revision_alias(revision) =>) and simplify:3427-3441to: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
- Upstream claim (Major): "
refresh_model_atstill leaks bare 404s / move wrapper intoresolve_revision/acquire_updategoes throughrefresh_model_at/RevisionClient::revisionis an unfixed 3rd site." Verified false on all four counts:refresh_model_at(flare/src/hub.rs:2279-2280) already wrapsresolve_revisionwithformat!("cannot check {}@{revision} for updates: {error}; the local version is unchanged (use --offline to skip the check)", origin.repository), so the repository and revision are already reported there.- Moving the wrapper into
resolve_revisionwould causerefresh_model_atto emit a redundant stuttering message (cannot check owner/model@gb10 for updates: cannot resolve owner/model@gb10: ...). Wrapping inresolve_primary_targetis therefore the right layer. acquire_update(flare/src/hub.rs:13941-13969) callsdownload_for_model_at(:434→resolve_primary_target), notrefresh_model_at, so it is already covered by this PR.- Both non-test callers of
RevisionClient::revision(flare/src/hub.rs:2171inscan_revisionsandflare/src/controller.rs:2649incheck_model_update) discard the error with.ok()?/else { continue; }; it is never shown to operators.
- Upstream claim (Blocking / Minor): "Missing
docs/TODO.txtentry and missing cross-link on #489 per@original-el8's review." Verified inverted/stale:@original-el8's comment on #489 told that docs-only PR not to document an unresolved defect indocs/multi-host.mdand to put unresolved defects indocs/TODO.txtperAGENTS.md:57-58. PR #603 fixes the defect, so adding an "unresolved defect" entry todocs/TODO.txtwould contradictAGENTS.md:57-58. PR #603 already cites#489in its description (creating the GitHub cross-reference visible on#489), and the author cannot edit another contributor's PR. - Upstream claim (Minor): "Status-only 404 message misattributes private/gated repo credential failures to a bad revision; add a credentials hint." Dropped as speculative UX preference:
cannot resolve {repository}@{revision}: {source}states factually what lookup returned 404 without guessing a cause (matching the PR's explicit design choice). - Upstream claim (Minor): "The
gb10-tp1row inpermanent_resolution_failures_are_not_retriedexercises the post-alias fallback path." Verified false ("gb10-tp1"is not inPLATFORMSathelios/src/core/naming.rs:15-18) and converted into the real Should Fix test gap above. - Upstream claim (Low): "
RevisionLookupErroris the only undocumented item in its neighborhood." Verified false: every neighboring helper inflare/src/hub.rs:3353-3460(fetch_primary,tp1_revision_alias,validate_commit,resolve_revision,resolve_primary_target,fetch_resolved_primary) is undocumented; also moot onceRevisionLookupErroris deleted. - Upstream claim: "
Cargo.lockunreadable /ureqversion unverifiable." Verified present atflare/Cargo.lock:1246-1262(hf-hub 0.5.0) and:3382-3399(ureq 3.4.2).