diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py index d34f8616..b260cc0a 100644 --- a/backend/routes/generate_code.py +++ b/backend/routes/generate_code.py @@ -254,6 +254,9 @@ async def process_chunk(content: str): except Exception as e: traceback.print_exc() print("Image generation failed", e) + # Send set code even if image generation fails since that triggers + # the frontend to update history + await websocket.send_json({"type": "setCode", "value": completion}) await websocket.send_json( {"type": "status", "value": "Image generation failed but code is complete."} )