From 387b2e5101677b305d9a6d998b46c01e6d01f988 Mon Sep 17 00:00:00 2001 From: mes123456 Date: Fri, 4 Sep 2026 08:10:44 +0800 Subject: [PATCH] fix(web): recover native geometry batches after fixture crashes --- my-tools/authorize_next_wbv2_task.py | 30 +++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/my-tools/authorize_next_wbv2_task.py b/my-tools/authorize_next_wbv2_task.py index b27268158..8450e044b 100644 --- a/my-tools/authorize_next_wbv2_task.py +++ b/my-tools/authorize_next_wbv2_task.py @@ -434,7 +434,7 @@ def native_geometry_batch(inventory: dict) -> dict | None: and unit.get("coverageStatus") != "VERIFIED" and unit.get("kind") == "node" and isinstance(unit.get("identifier"), str) - and unit["identifier"].startswith("GeometryNode") + and (unit["identifier"].startswith("GeometryNode") or unit["identifier"].startswith("FunctionNode")) ] if not candidates: return None @@ -461,6 +461,29 @@ def native_geometry_batch(inventory: dict) -> dict | None: } +def prepare_native_fixture(batch: dict, task: str, contract: dict) -> dict: + """Generate a native fixture, shrinking only when Blender rejects a mix.""" + if not (batch.get("nativeCompositorFixture") or batch.get("nativeGeometryFixture")): + return contract + while True: + try: + if batch.get("nativeCompositorFixture"): + ensure_native_compositor_fixture(batch, contract) + else: + ensure_native_geometry_fixture(batch, contract) + return contract + except SystemExit: + units = list(batch.get("units", [])) + if len(units) <= 1: + raise + units = units[: max(1, len(units) // 2)] + batch["units"] = units + batch["identifiers"] = [unit["identifier"] for unit in units] + batch["types"] = [unit["identifier"] for unit in units] + batch.pop("fixture", None) + contract = batch_contract(task, batch) + + def recover_blocked_native_batch(current: str, index: dict, plan: dict, inventory: dict) -> bool: """Shrink one failed auto-native batch to the last proven fixture shape. @@ -856,12 +879,13 @@ def main() -> int: digest = contract["batchId"].rsplit(":", 1)[-1] batch["fixture"] = f"tests/files/web/generated/wbv2-compositor-{digest}.blend" if args.write: - ensure_native_compositor_fixture(batch, contract) + contract = prepare_native_fixture(batch, module_task, contract) if batch.get("nativeGeometryFixture"): digest = contract["batchId"].rsplit(":", 1)[-1] batch["fixture"] = f"tests/files/web/generated/wbv2-geometry-{digest}.blend" if args.write: - ensure_native_geometry_fixture(batch, contract) + contract = prepare_native_fixture(batch, module_task, contract) + batch["batchId"] = contract["batchId"] write_planner_status({ "status": "ready", "reason": "source_backed_batch_selected",