Flue 2 Brought React Hooks to Agents — and the "Harness-First" Era Finally Has Its Manifesto
胡新宇
发布于 2026-08-15
Flue 2 (Cloudflare / Fred Schott) ships React-style agent hooks as the first stable harness-first framework. Why this is the React moment for agent composition.
Flue 2 Brought React Hooks to Agents — and the "Harness-First" Era Finally Has Its Manifesto
Fred Schott does not believe you can write an agent without a harness. "There is no agent without a harness," he told Latent Space last week (Latent Space, 2026-08-15). That sentence is the reason Flue 2 exists.
Flue 2 is the first stable release of the agent framework Schott has been building inside Cloudflare since Astro — his previous project — was acquired in January. It is also the first framework whose API treats React-style hooks as the foundational primitive for composing agents. Sixteen built-in hooks ship out of the box: useSkill(), useTool(), useSubagent(), plus room for custom ones. An agent in Flue is a JavaScript function that "re-renders on every turn," meaning before every model call.
This matters more than the framework itself. The agent-framework market has spent the last eighteen months arguing about routing, files, and prompts. Flue 2 just changed the question.
What Flue is, if you have not used it
Flue started as an internal issue-triage system inside the Astro repository. An LLM-driven script that reviewed GitHub issues, then gained the ability to take actions in the repo. Schott described it as "Claude Code, but 100% headless and programmable" in the v1 launch post (Schott on X, 2026-05). That is the origin story worth holding on to: Flue is not a research project. It is a production tool that was hardened on a real workload before it became a framework.
#Agent#AI Agent
The current Flue is the result of that hardening. It is TypeScript, it runs on Cloudflare's edge infrastructure (and can run on Vercel, as Vercel's own deployment guide confirms), and it ships with a minimal harness called Pi underneath. In Flue 1, the central metaphor was file-based routing, borrowed straight from Astro. In Flue 2, the central metaphor is hooks. The framework you would build on Flue today looks more like a React app than a Next.js app — and that is the whole point of the rewrite.
The agent framework wars, in one paragraph
Vercel shipped eve earlier this year. Cloudflare shipped Agents SDK. There is Mastra from the Gatsby team, LangChain's Managed Deep Agents, OpenAI's Agents SDK, Anthropic's evolving tooling, and a long tail of wrappers around the same LLM call. Most of them borrowed conventions from web frameworks — file-based routing in particular — because that is what the people building them already knew.
Schott tried the same thing in Flue 1. It did not work. "We kind of naively ported that over to Flue, thinking — great, well, I'll put your five agents in these five files, and that'll be the five routes that they expose," he said. "But for a lot of people building with Flue, especially the bigger customers, their whole company is one agent. They don't care about routing. There's one agent."
So he stopped copying web frameworks and went back to the layer underneath them: React.
Why React, specifically
Flue 2 is not "Astro for agents" or "Next.js for agents." Schott is explicit about this. The mental model is composition, not routing. From the Flue 2 launch post: hooks "let you build dynamic agents that can manage their own state, listen to agent lifecycle events, and even attach different resources and capabilities dynamically to enhance themselves at runtime."
That sentence is doing a lot of work. Read it again. "Attach different resources and capabilities dynamically to enhance themselves at runtime." The agent changes its own configuration as the conversation progresses. A support agent can bring in the account-management tool only after it has verified the user. A triage agent can hot-swap its own skills when it detects a new category of issue. The framework is no longer a static graph you wire up at deploy time. It is a living function that reconfigures itself every turn.
Bret Taylor said it first in June on the same podcast: "We're still trying to figure out who the reactive agents are and the jury is still out… We're sort of in the jQuery era of agents, not the react era." Flue 2 is the first attempt to take the next step in public. Whether it succeeds is a separate question. The category shift is already visible.
The Hook API, in concrete terms
Take useSkill(). A skill in Flue is a bundle of instructions and resources — basically a packaged behavior. With useSkill(), an agent decides mid-conversation whether to load a skill, which skill to load, and when to drop it. Same shape for useTool() and useSubagent(). The agent composes its own capabilities.
This is the inverse of the "agent is a prompt plus a tool list" pattern. In that pattern, you enumerate everything the agent can do up front, then watch it struggle with context bloat and tool-selection errors. In Flue, the agent composes its toolset on demand. Configuration is data, not setup.
There are sixteen hooks total. Schott left room for custom ones — which is the part most reviewers miss. The point is not "here are the hooks we shipped." The point is "here is the abstraction; build your own." Flue is betting the agent space needs a primitive, not a feature checklist.
What "harness-first" actually means
Flue is built on top of Pi (pi.dev), an open-source minimal harness. Schott's framing: Pi is to Flue as Vite is to Astro. Pi does not do too much. Flue is the opinionated layer that adds opinions.
A harness, in this vocabulary, is the environment an agent runs in: the model connection, the tool registry, the memory layer, the lifecycle manager, the permissions model. Without a harness, an agent is just a prompt. Schott's claim is not "harnesses are nice to have." It is closer to "without a harness you do not have an agent."
Vercel's eve holds the same position. That is the direct competition. The earlier frameworks — AI SDK, Cloudflare Agents SDK (the older one), Mastra — are now bolting harnesses on as features. Flue and eve start with the harness baked in. Everyone else is catching up.
The meta-harness question is open. Databricks' Omnigent, the self-improving Exo harness, and a half-dozen other projects are trying to be the harness above all harnesses — a unifying layer that lets you treat Pi, eve, and Flue interchangeably. Schott is not buying it. "The framework and the harness are very intertwined," he said. A meta-harness, in his view, would muddle the story. Whether you agree with him probably depends on whether you build agents or build tools for people who build agents.
Who wins, who loses
Winners: framework authors who were waiting for a hook-shaped primitive. Cloudflare, because Flue is a credible answer to Vercel eve without the Vercel lock-in. Developers who wanted one framework that runs on multiple clouds — Vercel has already published a guide for deploying Flue agents on its platform, and Cloudflare has the inverse guide. That is unusual. It only happens when a framework is genuinely portable.
Losers: anyone still betting on file-based routing as the dominant agent composition model. Anyone who shipped an agent SDK in the last six months and did not include a hook layer. The OG frameworks, unless they retrofit hooks fast.
Unchanged: model companies. OpenAI, Anthropic, Google still own the substrate. None of this framework churn changes which model you call. But the framework that wins the composition layer will steer how models get used — and that is a quiet kind of power.
What to watch next
Three signals worth tracking over the next quarter.
First, whether Vercel adds hooks to eve. If it does, the "harness-first + hooks" pattern is the consensus and Flue 2 becomes the trigger, not the winner. If it doesn't, eve is the alternative thesis to Flue, and the framework market bifurcates.
Second, whether Pi (the minimal harness underneath Flue) gets adopted outside Flue. If it does, Schott has shipped not just a framework but the substrate beneath it — a stronger position.
Third, whether the meta-harness conversation (Omnigent, Exo, and friends) produces a working cross-framework agent in the next six months. If yes, Schott's "framework and harness are intertwined" argument loses. If no, Flue's bundling choice is validated.
What a hook actually looks like
Strip the marketing and a Flue hook is a function that runs in the agent's lifecycle. When the model is about to be called, every registered hook runs in order. Each hook can mutate the agent's context — adding tools, loading skills, swapping subagents, logging state, rewriting the prompt. Then the model sees the new context, returns a result, and the hooks run again on the way out.
That round trip is the "re-render on every turn" line from the docs. It sounds expensive. It is. But the cost is paid in exchange for something web frameworks never had to offer: an agent that is aware of its own configuration and can rewrite it. There is no equivalent of this in the static file-routing world. You can write useState() in a component and the framework will re-run the component when state changes. Flue gives you the same shape, but for agent capability.
The implementation is TypeScript, which is a quiet but important choice. Most agent SDKs ship Python-first because the LLM ecosystem grew up around research notebooks. Flue is betting that the people who will build production agents in 2027 are full-stack JavaScript developers who already live in Node tooling. Whether that bet pays off depends on whether enterprises ship their agents in TypeScript or Python. The early signal — Vercel publishing a deployment guide, Cloudflare integrating Flue into its platform — suggests both vendors expect the answer is "yes, increasingly TypeScript."
The 2013 analogy, taken seriously
React shipped in 2013. Its core idea — components that re-render based on state, with hooks arriving later in 2019 — was not the only way to build a UI. Backbone, Angular, Ember, and Vue all competed. Six years later, the question of which framework to use was settled in React's favor not because it was technically superior in 2013, but because it captured the right mental model first. Everyone else had to retrofit.
The agent-framework market is at the 2013 stage. There are many frameworks. None has won. Most of them are competing on features, not on the right primitive. Flue 2 is the first framework to articulate the primitive clearly: agents are functions with hooks, not files with routes. Whether Flue wins the market is less important than whether the rest of the market adopts the primitive. If they do, the conversation in 2028 will not be "which agent framework?" It will be "which agent hooks do you use?"
That is the trajectory Schott is aiming for. His real product is not Flue. His real product is the mental model.
The sharp take
The agent framework market has been borrowing web conventions because the people writing them are web developers. That borrowed vocabulary has produced a generation of frameworks that look like Next.js, route like Astro, and limp when the agent has to do anything dynamic. Flue 2 is the first framework to admit that agents are not web pages. They re-render every turn. They compose themselves. They attach capabilities on demand. The right primitive is not a route. It is a hook.
Schott's bet is that the next eighteen months look more like 2013 than 2010 — more React, less jQuery. He may be wrong about Flue specifically. He is almost certainly right about the direction.
Sources
Latent Space interview with Fred Schott, "React for Agents: Astro Creator Brings Hooks to his Meta-Harness, Flue" (2026-08-15): https://www.latent.space/p/flue-2