fix(metadata): fail loudly when the sidecar write cannot land

update_model_metadata ignored the save_metadata result, so a fetch on a
drive that went offline mid-run was counted as success: the cache got
the fresh CivitAI payload while the durable sidecar never landed, and
every later fetch skipped the model as already fetched.

The save result now raises MetadataPersistError. In the bulk fetch path
this fails the item (reported in the summary, cache untouched, model
stays eligible for the next run); relink surfaces an honest 500.

Also corrects the stale known-limitation note in the scoped-scan plan:
a startup-offline root has been listed and re-admitted since Wave 6.
This commit is contained in:
Will Miao
2026-10-08 07:55:47 +08:00
parent 95acd6308a
commit acefe1a348
4 changed files with 71 additions and 5 deletions
+6
View File
@@ -45,6 +45,12 @@ class ResourceNotFoundError(RuntimeError):
pass
class MetadataPersistError(RuntimeError):
"""Raised when the metadata sidecar cannot be written to disk."""
pass
class LLMNotConfiguredError(RuntimeError):
"""Raised when an LLM-dependent operation is attempted but no provider is configured."""