From a3ec4b6e4d770d20b43da3154dc2bb6377adb01a Mon Sep 17 00:00:00 2001 From: Mawen Salignat-Moandal Date: Sun, 29 Nov 2026 16:02:34 +0100 Subject: [PATCH] Report the repository and revision on Hub lookup errors When Hugging Face returns HTTP 404 during core acquisition, the diagnostic omits the repository and revision. Orbit supplies the agent name, leaving the operator without the attempted model reference. Add the attempted repository and revision to a final HTTP 404 in primary core resolution and retain the Hub error as its cause. Apply the context after the resolver completes its retry and alias decisions. Operators can identify which reference failed while retaining the original HTTP status. The strengthened HTTP fixture test failed before the fix and passed after it on Linux ARM64. The signed-core alias test passed. The full Flare release suite passed with 242 tests and four ignored, using a temporary checkout with the stale Flare lockfile aligned to the Helios deepseek-recipe pin. The Orbit CLI workflow was not run. Design-Signed-Off-By: Codex (GPT-6); design-review=2e5b Signed-off-by: Mawen Salignat-Moandal --- flare/src/hub.rs | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/flare/src/hub.rs b/flare/src/hub.rs index 13e45ec79..0d664eb60 100644 --- a/flare/src/hub.rs +++ b/flare/src/hub.rs @@ -3395,13 +3395,50 @@ fn resolve_revision( Ok(info) } +#[derive(Debug)] +struct RevisionLookupError { + repository: String, + revision: String, + source: Box, +} + +impl std::fmt::Display for RevisionLookupError { + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + formatter, + "cannot resolve {}@{}: {}", + self.repository, self.revision, self.source + ) + } +} + +impl std::error::Error for RevisionLookupError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + Some(self.source.as_ref()) + } +} + fn resolve_primary_target( api: &Api, repo: &Repo, requested: Option<&str>, progress: Option<&flare_helios::core::progress::AcquisitionProgress>, ) -> Result<(Repo, String)> { - let info = resolve_revision(api, repo, progress)?; + let info = resolve_revision(api, repo, progress).map_err(|source| { + if matches!( + source.downcast_ref::(), + Some(ApiError::RequestError(error)) + if matches!(error.as_ref(), ureq::Error::StatusCode(404)) + ) { + Box::new(RevisionLookupError { + repository: repo.url(), + revision: repo.revision().to_owned(), + source, + }) + } else { + source + } + })?; let filename = choose_file( info.siblings.into_iter().map(|file| file.rfilename), requested, @@ -8580,6 +8617,9 @@ pub(crate) mod tests { .to_string(); worker.join().unwrap(); assert!(error.contains(&status.to_string()), "{error}"); + if status == 404 { + assert!(error.contains(&format!("owner/model@{revision}")), "{error}"); + } assert_eq!(log.lock().unwrap().documents[&route], 1); } }