previews · Architecture & design · Flue framework evaluation

Lawrence engineering · Evaluation · June 2026

Flue: a durable harness, on a different base

Flue is the Astro team's headless TypeScript agent harness — durable-first, with a defineAgent surface that looks just like ours. But the whole story is one fact: it's built on Pi (the harness inside OpenClaw) and Durable Streams, not the Vercel AI SDK. Where Mastra shares our base and is a viable pass-2 adopt, Flue is a parallel stack. So: don't adopt it — but borrow its durability design.

built on Pi, not the AI SDK durable streams, day one 1.0 beta · ~1 wk old

Update · AI SDK v7 (GA 2026-06-25). v7 now ships durable/resumable runs natively via WorkflowAgent, self-hostable in eu-west-2 through @workflow/world-postgres (own Postgres, zero US residency). That makes the headline takeaway here — "borrow Flue's Durable Streams design" — largely redundant: the capability is now in our own base. The verdict stands (don't adopt Flue), but the reason to study it shrinks to a reference. And v7's HarnessAgent can run Pi (what Flue is built on) directly. See the migration doc for the v7 base.

The one fact that frames everything

Flue does not use the Vercel AI SDK. Model calls go through Pi's pi-ai — its own multi-provider abstraction (Anthropic, OpenAI, Google, OpenRouter, any OpenAI-compatible endpoint), with its own tool-schema and streaming layer. Pi is Mario Zechner's MIT harness (the engine inside OpenClaw); Flue is the Astro team's ergonomic + durability + deploy layer on top of it. So this is the mirror image of the Mastra evaluation: Mastra shares our AI SDK base, so it drops into our stack for the pass-2 layer. Flue is a parallel base — adopting it means re-platforming off the AI SDK.

Mastra is "the layer above our loop." Flue is "a different loop." That single difference decides the verdict.

The irony worth noting: Pi rejected the AI SDK for the same reasons we bypass the Vercel gateway — direct provider SDKs, no gateway in the path, friendlier to self-hosted models. They reached our conclusion, just on a different stack. So the philosophy rhymes; the implementation doesn't compose.

What Flue is

Apache-2.0, from the Astro team (Fred Schott), 1.0 Beta shipped 2026-06-16 — about a week old. Positioned as "Astro/Next, but for agents": a headless harness for autonomous agents triggered by API/webhook/cron, not a chat app.

PieceWhat it is
defineAgentdefineAgent(() => ({ model, instructions, tools, skills, sandbox, cwd, durability })) — default export registers the agent. Near-identical shape to ours.
Pi (the harness)The agentic loop + tool calling + state, via pi-ai. Model ids are opaque strings (anthropic/claude-sonnet-4-6); a providers object configures endpoints.
Durable StreamsThe transport: every prompt, model response and tool result is appended to a replayable log. The source of truth is the log.
Tools / skillsdefineTool (Valibot schemas) + skills as .md files imported with { type: 'skill' }. MCP supported (mechanics unverified).
Sandboxeslocal() / in-memory just-bash / remote() connectors (E2B, Modal, Daytona, Cloudflare, Vercel Sandbox).
ServingAgents expose route (plain Hono middleware) → POST /agents/<name>/:id, event stream on GET. Standalone bundle or embed in a Hono server. Deploys to CF / AWS / Docker / Railway / Render / Node.

Flue vs ours vs Mastra

Same question as the Mastra eval, now three-way. The base-layer row is the one that decides it.

 FlueOurs (lawrence-api)Mastra
Base layerPi / pi-ai — own stack, not the AI SDKVercel AI SDK v6 + our provider registryVercel AI SDKsame as us
Embed in lawrence-apiEmbeds in Hono; we're Express → sibling/mount frictionNative (Express)Library, Express-friendly clean
State / residencyPluggable store; @flue/postgres → your Postgres, eu-west-2 ok (CF path = Durable Object SQLite)Self-host eu-west-2 (sessions deferred)Our Postgres + pg.Pool ok
DurabilityDurable Streams (append-only log, replay/resume) — day oneInngest; durable streams deferredInngest runner + DurableAgent
Human-in-the-loopNo documented Flue primitive (Pi has permissionMode) unverifieddeferredapprovals built-in
Sandboxes / code-execlocal()/in-mem safe on-host; remote() connectors carry US-pin risk (as Vercel Sandbox)nonenone
Tools / skillsdefineTool (Valibot) + .md skills + MCPAI SDK tools; VFS; Langfuse promptsAI SDK tools; sessions/memory/subagents
Maturity1.0 beta, ~1 wk, APIs changingin prodestablished
LicensingApache-2.0 (Pi: MIT); no managed cloudin-houseOSS

The standout: Durable Streams

The one thing genuinely worth taking from Flue — and it's exactly the pass-2 capability we deferred (sessions, durable streams, resume), self-hostable on our own Postgres.

APPEND-ONLY EVENT LOG = SOURCE OF TRUTH user promptevent 1 model responseevent 2 tool resultevent 3 model responseevent 4 ⚡ interrupt resume hereevent 5 → resume from the log — accepted work is never lost client reconnects (replays the log) store = your Postgres (@flue/postgres) save() · load() · delete() · eu-west-2 · no vendor cloud
Durable Streams: an append-only event log is the source of truth, so an interrupted run resumes from the log and a dropped client reconnects by replaying it. On Node the log persists through a pluggable store (@flue/postgres) — our Postgres in eu-west-2, no vendor cloud. This is the shape to borrow for our deferred pass-2 sessions/resume work — built on the AI SDK, not on Pi.

Residency

Better than you'd fear on state, same old trap on remote code-exec.

Verdict

Against our two locked constraints — the AI SDK bet and eu-west-2 self-host — Flue loses on the base layer while matching us on residency.

Avoid as a framework

  • Adopting it replaces the AI SDK with Pi — a re-platform, not a layer. Our registry, streaming surface, v6 tool calls, VFS don't carry.
  • Embeds into Hono, not Express; remote sandboxes reintroduce US-pinning; 1-week-old beta with unstable APIs — not a base for legal PII today.

Borrow the design

  • Durable Streams — append-only log as source of truth + pluggable save/load/delete Postgres store — as the reference for our deferred pass-2 sessions/durable-streams/resume, built on the AI SDK.
  • The skills-as-.md ergonomics, too.

Adopt? still Mastra

  • For the pass-2 layer, Mastra stays the better adopt: same AI SDK base, embeds as an Express-friendly library, reuses our Postgres + Inngest.
  • Flue's win (durability) is a design to copy, not a dependency to take.

One line: Flue is a clean, durable-first harness from a strong team, but it's built on Pi rather than the Vercel AI SDK — so adopting it means leaving our base, embedding into Hono, and betting legal PII on a one-week-old beta. Don't. Do borrow its Durable Streams architecture as the blueprint for our deferred durable-sessions work, implemented on the AI SDK; Mastra remains the pass-2 adoption candidate.

Couldn't verify (flagged)