This is critical for mobile AI agents where flaky networks are the default, not the edge case.
Check out the Realtime v2 docs to see how to make your streams bulletproof:
tgr.dev/pFhDVdI
@triggerdev.bsky.social
Open source background jobs and AI infrastructure (YC W23). β http://trigger.dev β http://github.com/triggerdotdev β http://trigger.dev/discord The official π¦ account for Trigger.dev
This is critical for mobile AI agents where flaky networks are the default, not the edge case.
Check out the Realtime v2 docs to see how to make your streams bulletproof:
tgr.dev/pFhDVdI
The code is simple. You don't manage websockets.
Backend:
`return stream.toResponse()`
Frontend (React):
`useRealtimeRun(runId)`
It handles the re-connection logic for you.
When the client reconnects? We automatically flush the buffered tokens and resume the stream exactly where it left off.
No "Network Error". No lost compute costs.
It works seamlessly with the Vercel AI SDK.
Introducing Realtime v2 streams.
Unlike a standard fetch stream, these are durable subscriptions.
If a client disconnects (network drop, tab close), the AI task keeps running in the background. Trigger buffers the tokens.
Most AI streams fail the moment your user switches apps or walks into an elevator.
Standard HTTP streams are fragile. If the connection drops, the generation is lost.
We built a better way for production AI apps. π§΅
We built the infrastructure so you can focus on the prompts.
Check out our Durable AI Agent examples (Next.js + AI SDK): trigger.dev/docs/guides...
This allows you to build agents that run for hours or days.
- Research agents that crawl 100 websites
- Coding agents that write full PRs
- Human-in-the-loop workflows that wait for approval
All without managing servers.
The Solution: Checkpoint-Resume.
Trigger.dev freezes your code execution while waiting for the LLM response.
1. Request sent to OpenAI
2. Compute shuts down (Cost = $0)
3. Response arrives
4. Compute wakes up and resumes
No timeouts. No wasted cash.
You could spin up a permanent server (EC2/VPS).
Now you have no timeouts.
But you are paying for 24/7 compute even when no one is using it.
And you have to manage scaling, health checks, and restart scripts.
You deploy your LangChain agent to Vercel.
It works for simple prompts.
Then a user asks a complex question.
The LLM 'thinks' for 45s.
β Function Timed Out.
β User frustrated.
β State lost.
Most AI agents are built on infrastructure that wasn't designed for them.
Serverless functions have 10-60s timeouts.
But complex reasoning chains (Deep Research, Coding Agents) take minutes.
Here is the 'Durable Execution' pattern that solves this π§΅
The repo is open source. If you want to run a CLI tool in the cloud and stream its output to a browser, this is a working reference you can fork.
tgr.dev/y4jWeXw
One CursorEvent type definition flows from task β stream β useRealtimeRunWithStreams hook β React component.
Full-stack type safety with zero duplication.
Cursor CLI outputs NDJSON. We parse it line by line, push events into
Realtime Streams v2, and render each one as a row in a React terminal
component.
The build extension runs ππππ -ππππ» πππππ://ππππππ.πππ/πππππππ | ππππ at image build time; the official installer, nothing custom. At runtime the task spawns the cursor-agent Node binary.
16.02.2026 17:30 β π 0 π 0 π¬ 1 π 0Trigger tasks run in their own isolated environments. You can install any binary via our build extensions, spawn it as a child process, and stream it to stdout.
This demo uses the Cursor CLI. Same pattern works for FFmpeg, Playwright, etc.
Run Cursor's headless CLI agent inside a Trigger.dev task and stream its output live to your app's frontend.
This open source demo: Next.js + Trigger. ~1,000 lines of code in total.
Here's what's interesting about the architecture β
Don't ship autonomous agents without a flight recorder.
See how deep our observability goes:
tgr.dev/nrXCwko
This integrates deeply with @OpenTelemetry.
If you use the Vercel AI SDK, we automatically capture the prompts and completions. You see exactly what the model saw before it hallucinated or crashed.
Now, every tool call, every LLM generation, and every `sleep()` is indexed.
You can filter by `traceId` to replay the exact execution path of an agent that ran last Tuesday.
It's like an MRI scan for your agent's brain.
We migrated our entire trace storage to @ClickHouseDB.
Why? Because AI agents generate massive amounts of telemetry data. A single recursive agent run can generate 10,000+ spans.
Debugging a 5-minute AI run is hard.
Debugging a 4-hour autonomous agent is a nightmare.
Console logs disappear. Stack traces get truncated. You have no idea why it looped 50 times and then died.
Here is how we solved observability for long-running agents. π§΅
Skills move agent behaviour out of fragile prompts and into reusable, reviewable instructions. Read our full post here β tgr.dev/VEbm6ZM
10.02.2026 17:30 β π 1 π 0 π¬ 0 π 0We shipped our Trigger Skills a couple of weeks ago; now weβve written up why they matter and how to properly use skills in practice.
If youβre building agents and care about consistency, correctness, and not re-prompting forever, this oneβs for you β
Read the full changelog here: trigger.dev/changelog/a...
09.02.2026 18:00 β π 0 π 0 π¬ 0 π 0β
Full support for AI SDK 6 alongside 4 & 5
β
Async validation handling for the new Schema type
β
Seamless migration - existing jobs keep working
We've added support for Vercel AI SDK 6, enabling:
β Run ToolLoopAgent as a durable task
β Stream agent activity to your frontend in real-time
β Pause execution mid-task for human approval
β Agents decide what to do next; call tools, gather context, or return
Don't build the infrastructure from scratch.
We implemented all 5 patterns using the AI SDK + Trigger.dev.
Fork the code here: tgr.dev/agents
Pattern 5: Evaluator-Optimizer
One model generates an output, another evaluates it, and the task loops until quality criteria are met.
This is an iterative system. You need recursion, clear approval thresholds, telemetry, and a hard stop on retries.
Pattern 4: Orchestrator-Workers
A central agent breaks down a task and delegates to worker agents.
This is a Distributed System. You need queues, retries, and error handling.
@triggerdotdev provides this out of the box.