Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(artifacts): improve artifact preview path resolution

Steven Enamakeleb31585bf911
diff --git a/crates/openhuman-core/src/artifacts/preview.rs b/crates/openhuman-core/src/artifacts/preview.rs
index 74106d973b..1f75ab9ad0 100644
--- a/crates/openhuman-core/src/artifacts/preview.rs
+++ b/crates/openhuman-core/src/artifacts/preview.rs
@@ -76,15 +76,13 @@ pub async fn read_body(
}
};
let converter = DocumentConverter::for_config(config);
- let display_path = super::store::get_artifact(&config.workspace_dir, id)
- .await
- .ok()
- .and_then(|meta| async {
- super::files::resolve_file(&config.workspace_dir, &meta, &files)
- .await
- .ok()
- }.await)
- .map(|path| path.to_string_lossy().into_owned());
+ let display_path = match super::store::get_artifact(&config.workspace_dir, id).await {
+ Ok(meta) => super::files::resolve_file(&config.workspace_dir, &meta, &files)
+ .await
+ .ok()
+ .map(|path| path.to_string_lossy().into_owned()),
+ Err(_) => None,
+ };
Ok(body_of(
&record,
file_store.as_ref(),