Image: GitHub
Why it mattersA design agent whose turn survives a function timeout removes the main failure that breaks long AI prompts, and shows how a Vercel team wires Queues and Workflow into one app.
Running a long AI prompt on a serverless platform usually ends the same way: the function hits its time limit, the reply stops mid-word, and the chat is dead. Vercel Labs released fx0, an open-source design agent built on its libfx library that keeps the turn alive when the function running it dies.
The repository picked up 135 stars and 26 forks within eight hours of going public. Vercel describes fx0 as a working reference example of libfx: you describe a page in a chat and the agent writes it as one HTML file, with the whole thing streamed, retried and resumable. The code is Apache 2.0.
How the durability works
The agent is created with one createFxAgent() call and runs each prompt as a session. Vercel says libfx stores each session in Workflow World, the store behind Vercel Workflow, and backs every turn with Vercel Queues. A turn runs for up to 800 seconds in the request that started it, which is the function's maxDuration. If the function dies before the reply finishes, Queues delivers the rest of the turn to a second route, app/api/libfx, and libfx picks up from the last saved step.
The repository publishes the Queue trigger as one entry in vercel.json, with a five-second retry on the __libfx_wkf_workflow_session topic. Vercel says fx0 has no recovery code of its own: the three load-bearing pieces are the agent, the wake handler and the queue subscription, and libfx owns the rest.
What else the repo ships
A paid chat uses the signed-in user's Vercel OAuth token and bills model calls to their team through Vercel AI Gateway. An unsigned visitor gets five free Opus 5.5 Fast prompts per IP, with BotID screening the trial and a server-only Gateway key funding admitted prompts. Trial funding never falls back to a paying customer's grant.
Every turn stops after 64 model steps, counting any subagents, which Vercel says is the cap that keeps a looping agent from running up a bill. Each chat picks its model, reasoning effort and fast mode, with Claude Opus 5.5 Fast as the default. The agent can search the web and fetch pages for reference, and starts from one of ten design.md style briefs picked from VoltAgent's awesome-design-md, or an uploaded one.
A sent message is a prompt when the chat is idle and a steer when a turn is already running. Vercel keeps the transcript, designs and settings in Redis and Neon. The live demo is at fx0.vercel.dev, where a visitor can take a brief, swap styles and copy the HTML out.
For a team building a long-running AI feature on Vercel, fx0 is a short example of how to wire three pieces together: Vercel Workflow for sessions, Vercel Queues for durable retries, and AI Gateway for billing and keys. The whole app is less than one afternoon of reading, and the durability path it shows is the one a chat agent written against a plain function usually leaves out.
Source
- vercel-labs/fx0 on GitHub
- Live demo: fx0.vercel.dev
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.
