面向 Agent 的 React:Astro 创始人为其 Meta-Harness Flue 引入 Hooks
英文标题:React for Agents: Astro Creator Brings Hooks to his Meta-Harness, Flue
Astro 创始人 Fred Schott 发布 Flue 2 的首个稳定版本,将 React 风格的“Agent Hooks”作为框架核心,使 Agent 能在每轮模型调用前重新渲染,并动态管理状态、工具、技能与子 Agent。Flue 2 内置 16 个 Hooks,包括 `useSkill()`、`useTool()` 和 `useSubagent()`,Schott 认为这种组合式模型更适合构建需要随对话和工作流实时适应的支持、分诊等真实 Agent。Flue 建立在开源极简 Harness Pi 之上,并坚持“没有 Harness 就没有 Agent”的定义;其主要竞争对象是同样内置 Harness 的 Vercel eve。尽管能利用 Cloudflare 的基础设施,Schott 强调 Flue 是面向所有托管平台的开源框架,并将主机可移植性视为核心原则。
1.5 KB
2.2 KB
1.3 KB
108.6 KB
364.4 KB
144.6 KB
96.2 KB
1.3 KB
67.0 KB
135.8 KB
963 B
中文
面向开发者的 Agent 框架仍处于早期阶段。今年推出的 Vercel eve 和 Fred Schott 的 Flue 等产品,正在形成这一领域的早期范式。
Schott 是 Web 框架 Astro 的创造者;其公司于今年 1 月被 Cloudflare 收购。他刚刚发布 Flue 2,这是其首个稳定版本,核心基础是 React 风格的“Agent Hooks”。
在 Flue 中,一个 Agent 由 JavaScript 函数表示。该函数会“在每一轮重新渲染”,也就是在每次模型调用之前。
Schott 是在意识到 React 的可组合性非常适合 Agent 开发后,决定加入 Hooks 的。
“我最初发推说,我们要做面向 Agent 的 Astro,或者面向 Agent 的 Next.js,”他告诉我们。“但后来我意识到:也许根本还没有人做出面向 Agent 的 React。”
编者注:我们上一次谈论面向 Agent 的 React,是与 Sierra CEO、OpenAI 董事长 Bret Taylor 的对话:
“我们仍在试图弄清楚哪些是响应式 Agent,目前尚无定论……我们大致仍处于 Agent 的 jQuery 时代,而不是 React 时代。”
**Hooks 使用 TypeScript 编写。**根据 Flue 2 发布文章,它们“让你能够构建动态 Agent:它们可以管理自身状态、监听 Agent 生命周期事件,甚至动态附加不同的资源和能力,从而在运行时增强自身。”
Flue 2 内置了 16 个 Hook,包括 useSkill()、useTool()、useSubagent()。你也可以添加自定义 Hook。

Flue 如何通过 React 风格 Hooks 演进;图表作者:Richard MacManus
Hooks 为开发者带来的能力是:它们**让 Agent 更具动态性,因为 Agent 的配置可以随着对话或工作流推进而变化。**Schott 表示,构建“真正的客服机器人、真正的分诊机器人”需要这种能力,因为它们不可能被完全预先配置。Agent 不能只是静态的——它必须实时适应用户需求或具体情境。
Agent Hooks 将这些能力带给 Flue。例如,客服 Agent 在先验证用户身份之后,可能会接入账户管理工具。
自 Schott 在 5 月初公开发布 Flue 1 以来,他对如何构建 Agent 框架的思考迅速演变。最初,他想把既有 Web 框架的概念应用到这个新 Agent 框架中。他以基于文件的路由为例。
“所以我们有些天真地把它迁移到 Flue 中,认为——很好,我会把你的五个 Agent 放进这五个文件,它们就会暴露出五条路由。但对许多用 Flue 构建产品的人来说,尤其是大型客户,他们的整个公司就是一个 Agent。他们不关心路由。只有一个 Agent。”
因此,在最早一批 Flue 用户展示出这些模式后,可组合性便成为 Schott 首要考虑的问题。这又让他回到了 React。
“正如你可以从 Flue 2 API 看到的,我们的灵感更多来自 React [...],而不是 Astro 或 Next.js——它更少关乎路由和这些网站概念,更多关乎从最基础的层面,如何将一个 Agent 组合到许多不同事物之上?”
Flue 的一个关键概念是,Agent 必须拥有一个 Harness——这意味着它所处的环境能够提供完成各类任务所需的上下文和能力。
Schott 解释道:“你和你的代码不再是通过脚本来驱动 LLM、告诉它该做什么;而是把 Agent 放入这个 Harness 中,它能够自行驱动并解决问题。”
Flue 构建在 Pi 之上,Pi 是一个开源的极简 Harness。从本质上说,Flue 是对 Pi 的一套带有明确观点的实现:它加入了 Schott 认为有助于开发者构建 Agent 的功能。例如,Flue 2 的托管 Agent 现在采用开源构建工具 Vite 构建。
实际上,Schott 将 Pi 的角色比作如今 Vite 在 Astro 之下所扮演的基础性角色。
“我认为 Pi 可以承担这一角色,它提供了恰当的抽象——它做得不会太多,但提供了恰当的 API,让我们可以进一步说:好,让我们以带有明确观点的方式在此之上扩展,做得更多。”
构建在 Pi 之上,意味着要承诺内置 Agent Harness。
“我们早期的判断是,Harness 实际上不是一个功能,而是你如何定义 Agent 的根本所在,”Schott 表示。“没有 Harness,就没有 Agent。”
Flue 项目始于今年早些时候的 Astro 仓库,最初是一个 Issue 分诊系统。起初,它是一个由 LLM 驱动、用于审查 Issue 的脚本或工作流。但随后,Schott 解释说,它获得了在仓库中执行操作的能力。
“它开始从仓库中的自动化,转向希望将 Claude Code 体验变为无头模式、变得可托管,并在云端运行。”
因此,Harness 作为锚点的想法由此出现。实际上,在他于 5 月初发布的 v1 发布文章中,Schott 将 Flue 描述为 “就像 Claude Code,但 100% 无头且可编程”。
我自己也使用 Claude Code 测试了 Flue;它引导我完成了第一个 Flue Agent 的设置。Schott 确认,这也是许多开发者使用 Flue 的方式。
谈及 AI 编程 Agent 时,他说:“我们确实是在为他们构建。我们的整个入门流程就是,把这个提示词交给你的 Agent,它会引导你完成整个过程。我们的所有文档都支持 Markdown。”
与 Flue 最接近的对比对象是 Vercel 的 eve,后者同样将 Harness 视为基础。Vercel 和 Cloudflare 曾公开发生过争执,但 Schott 对 eve 的评价相当慷慨。
“我认为 Eve 是最直接的竞争对手,”Schott 说。“它在差不多同一时间出现,因此也持有 Harness 内置的相同观点。”
[这是真实人生吗?· 2026 年 6 月 17 日下午 8:05 · 5.77 万次浏览
35 条回复 · 8 次转发 · 672 个点赞](https://x.com/FredKSchott/status/2067337941551301041)
Schott 还提到了他所谓的“OG Agent 框架”,即早于 Flue 出现、因此并非围绕 Harness 作为核心概念创建的框架。他列出了 Vercel 的 AI SDK、Cloudflare 的 Agents SDK 以及 Mastra(由构建 Gatsby 的同一团队开发;Gatsby 是早于 Astro 的 Web 框架)。
尽管这些“OG Agent 框架”如今都在加入 Harness,Schott 认为那是额外添加的功能;而 Flue 和 eve 都原生内置 Harness。
我问他,Flue 与正在出现的“Meta-Harness”相比处于什么位置,例如 Databricks 的 Omnigent,以及可能包括能够自我改进的 Exo Harness。
注:本周末我们还将发布对 Exo 联合作者 Alex Krentsel 的访谈;很值得观看,其中还附带关于 OpenClaw 架构的额外讨论!
Schott 正确地指出,在这个早期阶段,人们甚至对 Meta-Harness 一词究竟意味着什么都存在困惑。不论如何,他认为,用一个 API 跨所有 Harness 工作会让 Flue 的定位变得模糊。他的框架明确规定了技能如何在 Flue 中运行、子 Agent 如何运行,等等。正如他所说,“框架 [Flue] 和 Harness 是紧密交织的。”
他个人认为 Meta-Harness 的讨论很有意思,也曾尝试过 Exo,但表示那是“另一种兴趣场景,与托管 Agent 并没有真正关系”。
在整场访谈中,Schott 多次提及能够利用其雇主 Cloudflare 的工具和基础设施。但他也非常明确地表示,Flue 是“面向每一个托管平台的开源框架”,并希望它始终如此。
“最好的工具,是那些能浮于托管平台之上的工具,”他说。“这为最多的开发者采用和最多的创新打开了大门。”
主机可移植性是 Flue 的定义性原则之一——这或许也是它与 Vercel eve 的根本区别所在。**尽管 eve 也可以自行托管,但它经过优化,可充分利用 Vercel 的众多功能。**当然,这是 Vercel 已知的打法;它对 Next.js 也采取同样的做法。
尽管如此,Vercel 本身已经展示了如何将 Flue Agent 部署在 Vercel 上。因此,两家公司可以友好协作。
我还提到了 LangChain 新推出的 Managed Deep Agents,将其作为托管 Agent 平台进入市场的一个例子。不过,Schott 表示,托管 Agent 产品目前不在 Flue 的路线图中。
“对我们来说还太早了,我们只是专注于构建最好的 Harness,”他说。
可通过链接访问 Flue 和 Fred;Richard 的账号是 @ricmac。这是我们正在为订阅者尝试的一个全新文字访谈系列——欢迎告诉我们你的反馈!
English / 原文
Agent frameworks for developers are still at an early stage, with the likes of Vercel’s eve and Fred Schott’s Flue — both launched this year — setting the early template.
Schott is the creator of the web framework Astro, which led to his company being acquired by Cloudflare in January. He’s just released version 2 of Flue, its first stable release, which has as its foundation React-style “Agent Hooks.”
In Flue, an agent is represented by a JavaScript function. This function “re-renders on every turn,” meaning before every model call.
The addition of hooks came after Schott realized that React’s composability would be a great fit for agent development.
“I originally tweeted that we were building the Astro for agents or the Next.js for agents, ” he told us. “ But then I realized: maybeno one has even built the React for agents.”
Editor’s Note: we last talked about the React for Agents with Bret Taylor, CEO of Sierra and Chairman of OpenAI:
“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.”
Hooks are authored in TypeScript. According to the Flue 2 launch post, they “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.”
There are 16 built-in hooks in Flue 2, including useSkill(), useTool(), useSubagent(). You can also add custom hooks.
How Flue evolved via React-style hooks; diagram by Richard MacManus
What hooks open up for developers is that they make an agent much more dynamic, by allowing its configuration to change as a conversation or workflow progresses. Schott said this is needed to build “real support bots, real triage bots,” because they can’t be fully configured in advance. The agent can’t just be static — it has to adapt in real-time to what the user wants or the situation demands.
Agent hooks bring those capabilities to Flue. For example, a support agent might bring in an account management tool after first verifying a user.
Schott’s thinking about how to build an agent framework has evolved rapidly since he publicly launched Flue 1 in early May. Initially, he wanted to take existing web framework concepts and apply them to his new agent framework. He uses file-based routing as an example.
“So 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. 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 after the first Flue users showed these early patterns, composability became front of mind for Schott. That led him back to React.
“As you can see from the Flue 2 API, we’re taking it more from React [...] than we are from Astro or Next.js — where it’s less about routing and these website concepts and more about, at its base level, how do you compose an agent on many different things?”
A key concept in Flue is that an agent must have a harness — meaning that it’s in an environment where it has access to the context and capabilities needed to accomplish various tasks.
“Instead of you and your code driving the LLM and telling it what to do with scripts, you’re putting the agent into this harness, and it is able to drive itself and work through problems ,” explained Schott.
Flue is built on top of Pi, an open source minimal harness. Essentially, Flue is an opinionated take on Pi — adding features that Schott thinks are helpful to developers building agents. For example: hosted agents in Flue 2 are now built with Vite, an open source build tool.
Indeed, Schott likens Pi’s role to the foundational role that Vite now plays beneath Astro.
“I think Pi can serve that role, where it’s the right abstraction — it doesn’t do too much, but it gives the right APIs that then we can go and say, well, let’s have an opinionated take on this that does more.”
Building on Pi meant committing to having a built-in agent harness.
“Our early bet was that the harness is actually not a feature, but it’s fundamental to what you think an agent is,” Schott said. “There is no agent without a harness.”
The Flue project began earlier this year within the Astro repository, as an issue-triage system. At first, it was an LLM-driven script or workflow reviewing issues. But then, explained Schott, it gained the ability to take actions in the repo.
“It started to transition from just automation in a repo to wanting to take the Claude Code experience, make it headless, make it hostable and run it in the cloud.”
So that’s when the idea of a harness as anchor emerged. Indeed, in his v1 launch post in early May, Schott described Flue as “like Claude Code, but 100% headless and programmable.”
I myself tested out Flue using Claude Code, which guided me through setting up my first Flue agent. And Schott confirmed this is how many developers use Flue.
“We very much are building for them,” he said, regarding AI coding agents. “Our whole onboarding flow is that, you know, pass this prompt to your agent, it’s gonna guide you through it. All of our docs have markdown support.”
The closest comparison to Flue is Vercel’s eve , which also treats the harness as foundational. Vercel and Cloudflare have been known to beef in public, but Schott is generous in his opinion of eve.
“Eve, I think, is the most directly competitive,” Schott said. “It came around at the same time, so it had that same take that a harness is built-in.”
[is this real life? 8:05 PM · Jun 17, 2026 · 57.7K Views
35 Replies · 8 Reposts · 672 Likes](https://x.com/FredKSchott/status/2067337941551301041)
Schott also referenced what he called the “OG agent frameworks,” which came before Flue and so weren’t created with a harness as the central concept. He listed Vercel’s AI SDK, Cloudflare’s Agents SDK, and Mastra (developed by the same team that built Gatsby, a web framework predating Astro).
While these “OG agent frameworks” are all adding harnesses now, Schott considers that an added feature — whereas Flue and eve both have built-in harnesses.
I asked where Flue sits compared to emerging “meta-harnesses,” like Databricks’ Omnigent and perhaps even the self-improving Exo harness.
Note: we’re also publishing our interview with Exo coauthor Alex Krentsel this weekend; it’s worth a watch and has a bonus discussion on OpenClaw architecture!
Schott rightly noted that there’s confusion about what the term meta-harness even means at this early stage. Regardless, he thinks having one API for working across all harnesses would muddle the story for Flue. His framework specifically defines how skills work in Flue, how subagents work, and so on. As he put it, “the framework [Flue] and the harness are very intertwined.”
He personally finds the meta-harness discussion fascinating, and has played with Exo, but says it’s “a different interest scenario that isn’t really related to hosted agents.”
Throughout the interview, Schott referenced being able to take advantage of his employer Cloudflare’s tooling and infrastructure. But he was also very clear that Flue is an “open source framework for every host,” as he put it, and he wants it to stay that way.
“The best tools are the ones that float above the host,” he said. “That opens the door for the most developer adoption and the most innovation.”
Host portability is one of Flue’s defining principles — and perhaps that’s where the fundamental difference to Vercel’s eve is. While eve can also be self-hosted, it is optimized to take advantage of Vercel’s many features. Of course that’s a known playbook of Vercel, which does the same thing with Next.js.
All that said, Vercel itself has shown that a Flue agent can be deployed on Vercel. So the two companies can play nice together.
I also mentioned LangChain’s new Managed Deep Agents offering as an example of hosted agent platforms coming onto the market. However, Schott said a managed agents product is not currently on Flue’s roadmap.
“It’s so early for us, we’re just focused on building the best harness,” he said.
Links to findFlue and Fred online; Richard is at @ricmac. This is a new written interview series we are trying out for subscribers — let us know your feedback!