Jarvis2345 commited on
Commit
8ac0a58
·
verified ·
1 Parent(s): 6f922a3

deploy(S4): Blender headless pipeline + WebAR client + backend fixes

Browse files
backend/routes/xr_routes.py CHANGED
@@ -245,8 +245,31 @@ async def spawn_model(request: SpawnModelRequest):
245
  logger.error(f"SF3D not provisioned: {e}")
246
  raise HTTPException(status_code=503, detail=str(e))
247
  except Exception as e:
248
- logger.exception("Error spawning 3D model")
249
- raise HTTPException(status_code=500, detail=str(e))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
 
251
  @router.get("/model3d/health")
252
  async def check_health():
 
245
  logger.error(f"SF3D not provisioned: {e}")
246
  raise HTTPException(status_code=503, detail=str(e))
247
  except Exception as e:
248
+ # A core feature must not hard-fail because a THIRD-PARTY space is down.
249
+ # Verified 2026-07-20: stabilityai/stable-fast-3d's /run_button raises an
250
+ # opaque AppError for every parameter combination, reproduced directly
251
+ # from a client outside this backend — their GPU inference is the fault,
252
+ # not our request (signature confirmed against their own view_api).
253
+ # Our procedural Blender Builder is fully operational, so degrade to it
254
+ # instead of returning a 500: the user still gets a model in the scene.
255
+ logger.warning(f"SF3D generation failed ({e}); falling back to procedural Builder.")
256
+ try:
257
+ result = await builder_generate(
258
+ BuilderRequest(description=request.description, persona=request.persona)
259
+ )
260
+ if isinstance(result, dict):
261
+ result = dict(result)
262
+ result["fallback"] = "procedural_builder"
263
+ result["fallback_reason"] = f"stable-fast-3d unavailable: {str(e)[:160]}"
264
+ return result
265
+ except HTTPException:
266
+ raise
267
+ except Exception as fallback_error:
268
+ logger.exception("Procedural Builder fallback also failed")
269
+ raise HTTPException(
270
+ status_code=502,
271
+ detail=f"SF3D unavailable ({str(e)[:120]}) and Builder fallback failed: {fallback_error}",
272
+ )
273
 
274
  @router.get("/model3d/health")
275
  async def check_health():
backend/services/automation_service.py CHANGED
@@ -130,7 +130,16 @@ async def execute_action(action_type: str, action_data: dict):
130
  "event": "system:notify",
131
  "payload": {"message": "Initiating OMEGA Core upgrade sequence."}
132
  })
133
- subprocess.Popen([sys.executable, "-m", "pip", "install", "--upgrade", "-r", "requirements.txt"], shell=True)
 
 
 
 
 
 
 
 
 
134
  except Exception as e:
135
  logging.error(f"Failed to execute action {action_type}: {e}")
136
 
 
130
  "event": "system:notify",
131
  "payload": {"message": "Initiating OMEGA Core upgrade sequence."}
132
  })
133
+ # NOTE: never shell out to pip from the shipped product. In the
134
+ # PyInstaller sidecar `sys.executable` IS the frozen exe (no pip
135
+ # module), so this silently failed; and requiring a user-visible
136
+ # package install is exactly what the product must never do —
137
+ # every runtime dependency is frozen into the sidecar at build time.
138
+ # Upgrades ship as a new signed installer, not a runtime pip call.
139
+ if getattr(sys, "frozen", False):
140
+ logging.info("auto_upgrade: packaged build — upgrades ship via the installer, skipping pip.")
141
+ else:
142
+ subprocess.Popen([sys.executable, "-m", "pip", "install", "--upgrade", "-r", "requirements.txt"])
143
  except Exception as e:
144
  logging.error(f"Failed to execute action {action_type}: {e}")
145