Image handling and AI generation

Change Log v0.1.9: Visual Project Snapshots & The Infrastructure Gauntlet
The hallmark of a premium developer tool isn't just how well it writes code—it's how it makes you feel when you log in. A text-heavy list of recent projects feels like a database dump. We wanted Gor://a Builder to feel like a high-end digital product gallery.
With version 0.1.9, we are introducing Project Snapshots. But getting this feature across the finish line required navigating one of the most intense infrastructure and debugging gauntlets we have faced yet.
Here is how we transformed the dashboard, and the sinister technical traps we had to disarm along the way.
AI-Generated Project Snapshots
Starting today, whenever you create a new app, Gor://a doesn't just spin up a WebContainer—it kicks off a FastApi BackgroundTask.
Using your cryptographically secure gb_live_ key, the backend silently communicates with our internal AI Proxy Gateway. It enhances your initial prompt and commands the Fireworks native image model to render a sleek, professional UI thumbnail for your specific app idea.
Zero-Storage Infrastructure (Base64 Injection)
Instead of wrestling with AWS S3 buckets or Supabase Storage URLs, we engineered a completely serverless storage flow. The proxy requests a b64_json response, which is injected directly into a new snapshot_b64 column in your database. The result? Instant, flush-mounted visual cards on your dashboard with zero external image loading latency.
The Debugging Crucible
Shipping this background pipeline was not without casualties. We hit three major infrastructure walls and engineered our way out of every single one:
1. The CodeMirror Dependency Crash
While updating the editor UI to support the new data flows, the entire IDE suddenly went completely blank. The culprit? Our CDN (esm.sh) was pulling two conflicting versions of @codemirror/state in the background. Because CodeMirror relies on strict instanceof checks, the duplicate states caused a fatal JavaScript crash on line 1.
The Fix: We locked down exact version numbers across the board and deployed a strict
?deps=parameter on all CDN URLs, forcing absolute dependency deduplication across the editor's extensions.
2. The API Schema Trap
Even after the tunnel was cleared, the images weren't saving. We discovered that while our proxy flawlessly handles OpenAI-compatible requests, Fireworks' native playground-v2-5 model uses a completely different JSON schema, returning a direct array [{"base64": "..."}] instead of OpenAI's nested dictionary format.
The Fix: We rewrote the background parser to be fully schema-agnostic. It dynamically detects whether the upstream provider is returning a list or a dictionary, safely extracts the Base64 string, formats the HTML
data:imageURI prefix, and writes to the database.
The Result
The backend plumbing is now completely bulletproof. The dashboard looks like a premium SaaS product, and the entire token billing flow handles background tasks effortlessly.