Restore legacy MSR timeline image fallback

This commit is contained in:
OpenClaw Agent
2026-07-22 09:03:57 +00:00
parent 5347ca3dbc
commit 9ebc488072

View File

@@ -1425,6 +1425,36 @@ def _extract_runtime_character_entries(tdata: dict, character_set, image_cache:
except Exception as e: except Exception as e:
log.warning("[LTXDirector] Could not process external character_set input: %s", e) log.warning("[LTXDirector] Could not process external character_set input: %s", e)
if entries:
return entries
try:
for char_info in tdata.get("characters", []):
images_list = char_info.get("images", [])
legacy_b64 = char_info.get("imageB64", "")
if legacy_b64 and not images_list:
images_list = [{"b64": legacy_b64, "name": char_info.get("fileName", "")}]
loaded_images = []
for img_info in images_list:
tensor = _load_image_source(
img_info.get("b64", ""),
img_info.get("name", ""),
cache=image_cache,
input_dir=input_dir,
)
loaded_images.append(tensor)
entries.append(
{
"images": loaded_images,
"description": char_info.get("description", "") or "",
"alias": _normalize_character_alias(char_info.get("alias", "")),
}
)
except Exception as e:
log.warning("[LTXDirector] Could not process legacy timeline character slots: %s", e)
return entries return entries