artifacts: make beets more forgiving, and handle errors with logs

This commit is contained in:
2026-06-11 21:41:29 +02:00
parent 5784c2440a
commit a049cdacdb
2 changed files with 22 additions and 13 deletions
+8 -1
View File
@@ -138,8 +138,15 @@ impl Session {
async fn tool_artifact_query(&mut self, args: BeatsQueryArgs) -> ToolResults {
let mut messages = vec![];
messages.push(ConversationEntry::ShipComputer(format!("Executing archive query {:?}", args)));
log::info!("Executing beets query {:?}", args);
if let Ok(output) = args.execute() {
self.scenery.artifacts.push(output);
for track in &output {
if let Some(merge_target) = self.scenery.artifacts.iter_mut().find(|a| { *a == track }) {
merge_target.merge(track.clone());
} else {
self.scenery.artifacts.push(track.clone());
}
}
} else {
messages.push(ConversationEntry::ShipComputer("Unable to execute query!".into()));
};