12-04 更新 实时
首页/ 技术栈/ 正文

iFood 如何在 15,000 个代码仓库中扩展编码智能体

技术栈 来源:OpenAI Blog 2026-11-24 08:00 3 阅读 机器翻译
iFood 如何在 15,000 个代码仓库中扩展编码智能体

这些任务单看都不难。真正的挑战在于任务数量成倍增加的时候。

“为单个代码仓库解决这个问题很容易,难的是规模化解决,”iFood 高级软件工程师 Victor Coelho 说。“Remote Agents Platform 的设计目标,就是让规模化解决这个问题成为可能,覆盖全部 15,000 个代码仓库。”

在该平台出现之前,每个团队都用自己的方式应对这个问题——而他们都撞上了同一道障碍。

“以前我们的解决方案是碎片化的。想象一下,iFood 的好几个团队在试图解决不同的问题,却没有这一层,也就是没有这个可用的智能体式运行时。最终,那些解决方案总是会撞上同一个问题。”

缺的并不是智能或应用场景,而是执行基础设施——一个专用的运行时。

“团队可以专注于解决自己的业务问题,把执行交给我们的平台。”

——Victor Coelho,iFood 高级软件工程师

该团队将 Remote Agents Platform 描述为一个 API,用于启动远程的智能体式编码任务。整个循环包含三步:用户通过 REST 调用提交提示词和环境要求;平台在隔离沙箱内的专用远程运行器上处理该任务;之后取回结果。

“该平台的入口,也就是它的接口,是一个简单的 REST API。用户可以通过这个 API 创建所需的任务运行。在内部,我们处理并管理整个生命周期,并将执行委托给隔离的沙箱,”他解释道。任务进度可以实时监控。

运行器的内部设计在两种不同类型的步骤之间交替——而这种组合使整个工作流变得可预测。

确定性步骤在工作流的两端:开始时克隆代码仓库、导入智能体可使用的技能、设置工作分支;结束时发布合并请求并提供生成的产物。中间则是智能体式执行本身,在沙箱内运行 GPT‑5.6 Luna。

“这是两者的结合:确定性步骤与工作流中的智能体式执行。”

沙箱运行 Ubuntu,并包含 iFood 生态系统所需的工具链——Python、Java、Kotlin、C#、TypeScript、Rust、JavaScript 和 Go——以及通用工具。在沙箱之外,智能体可以访问 Nexus、GitLab、Docker、Snyk、Kubernetes 和 AWS。

模型的选择归结为三个需综合考虑的因素,而不是仅凭其中一个。

“我们选择 GPT‑5.6 Luna,是因为在同一检查点的模型中,基准测试显示它在智能、效率和执行速度——即完成任务的速度——之间提供了极佳的平衡。这三项特质共同促使我们选择了 GPT‑5.6 Luna。”

对于为扩展而构建的平台而言,这种平衡比一次性用例更为重要。在消耗数万个 Token 的情况下,每次运行 4 美分的平均成本不再是一个次要细节,而成为一项架构层面的考量。

“考虑到我们计划在 iFood 的众多用例中扩展该平台,OpenAI 的模型所提供的效率与智能之间的平衡,确保我们能够可持续地扩展。”

—Victor Coelho,iFood 高级软件工程师

大规模委派执行带来了一个新挑战:自动判断智能体是否完成了它应该做的事。

iFood 的答案在于会话之后的步骤。一旦执行完成,结果会使用 OpenAI 的 Structured Outputs 进行处理,这要求输出符合预定义的契约。

“我们使用 Structured Outputs 处理结果,这确保响应遵循预定义的契约。从智能体的会话中,我们可以在预期的响应结构内识别输出。这有助于减少不确定性,并确保我们总能从智能体会话中获得响应,无论结果是正面还是负面。”

—Victor Coelho,iFood 高级软件工程师

该平台已经为一个 iFood 内部安全产品提供支持,该产品会扫描 15,000 个代码仓库中易受攻击的依赖项,并尝试修复它们。

这次迁移产生了直接影响:“借助我们的平台,这些更改、这些修复的准确率提高了一倍以上,”Coelho 说。

这个用例体现了该平台背后的理念:安全团队无需自建智能体运行时,也不必成为智能体编排方面的专家,它只需要调用一个 API。

该团队强调的是异步执行让开发者得以腾出手来做什么,而非取代开发者。

由于任务被委派出去并在无人监督的情况下运行,开发者不必一直盯着它。

“他们在开会时,就可以启动一项代码修复、一次性能分析,或其他更常规一些的任务——这类任务当下可以委派出去,不必盯着。”

常规工作不再争夺团队的注意力,从而为需要判断力的问题留出时间。

“你不必全程盯着工作进行,也能释放这些生产力收益。”

——Victor Coelho,iFood 高级软件工程师

Remote Agents Platform 被设计为一个内部层,其思路与 OpenAI 向外部客户提供这类任务的方式有相似之处。

“Remote Agents Platform 从 OpenAI 的 API 中汲取了大量灵感,既包括 Batch API,也包括更新的 OpenAI 产品 Agents API。我们构建了一个与这些产品类似的平台,但仅供 iFood 内部使用。”

这种借鉴并不止于概念层面,还延伸到接口设计、资源组织方式,以及异步执行、稍后取回结果的做法。

“这些产品直接启发了我们构建自己的解决方案。”

——Victor Coelho,iFood 高级软件工程师

该平台已完成超过 25,000 个任务,消耗超过 270 亿个 Token,平均每次运行成本为 US$0.04。

迁移到 Remote Agents Platform 之后,这个内部安全平台的修复准确率和已解决的漏洞数量都增长了一倍以上。

覆盖范围延伸至 iFood 旗下超过 15,000 个代码仓库。

所有运行均使用 GPT‑5.6 Luna,选择它是因为它在智能、效率与速度之间取得了平衡。

Structured Outputs 确保每次会话返回的结果都遵循预定义的契约,无论结果是正面还是负面。

产品团队已从构建碎片化解决方案,转向通过 REST API 委托智能体式执行。

瓶颈往往在于运行时,而不是用例。多个团队已经知道他们想要自动化什么;他们缺少的是运行它的环境。

将确定性步骤与智能体式执行结合起来。克隆、发布和使制品可用并不需要模型;而介于其间的复杂任务则需要。

将每次运行的成本视为架构决策。在规模化时,每项任务的成本决定了哪些任务可以自动化。

要求输出遵循契约。没有结构化响应,在大规模场景下就无法知道智能体是否实现了其目标。

异步执行才是真正的生产力提升。其价值在于无需监控工作,而不是一边盯着它一边更快完成。

通过内部 API 暴露智能体式能力,以便其他团队无需重建基础设施即可使用。

将每次运行隔离在各自的沙箱中,并预先安装好你所在生态的工具链。

选择模型时,应综合考虑智能水平、成本和速度,而不是只看单一基准测试。

使用结构化输出自动区分成功与失败。

从拥有明确痛点和高频需求的内部用户入手——在 iFood,这个用户就是安全平台。

团队计划将该平台推广到 iFood 内部更多的用例,扩大把智能体式执行委托给它的内部产品范围——而每项任务的成本将决定这种扩展能否持续。

加入全新的工作时代

全球已有超过 100 万家企业借助 OpenAI 取得实质性成果。

Cisco 与 OpenAI 用 Codex 重新定义企业工程

Rakuten 借助 Codex 将问题修复速度提升一倍

Endava 如何借助 Codex 构建智能体式组织

译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(How iFood scales coding agents across 15,000 repositories)

None of these tasks is difficult on its own. The challenge comes when those tasks multiply.

“Solving this for one repository is easy. The challenge is solving it at scale,” says Victor Coelho, Senior Software Engineer at iFood. “The Remote Agents Platform is designed to make it possible to solve this at scale across all 15,000 repositories.”

Before the platform, each team tackled the problem in its own way—and they all ran into the same obstacle.

“Before, we had fragmented solutions. Imagine several teams at iFood trying to solve different problems, but without this layer, this agentic runtime, available to them. In the end, those solutions always ran into the same problem.”

What was missing wasn’t intelligence or a use case. It was execution infrastructure. A dedicated runtime.

“Teams can focus on solving their business problems and delegate execution to our platform.”

—Victor Coelho, Senior Software Engineer, iFood

The team describes the Remote Agents Platform as an API that launches a remote agentic coding task. The cycle has three steps: the user submits a prompt and environment requirements through a REST call; the platform processes the task on a dedicated remote runner inside an isolated sandbox; and the result is retrieved later.

“The platform’s entry point, its interface, is a simple REST API. Users can use this API to create the runs they need. Internally, we handle and manage the entire lifecycle and delegate execution to isolated sandboxes,” he explains. Task progress can be monitored in real time.

The runner’s internal design alternates between two different types of steps—and that combination makes the overall workflow predictable.

Deterministic steps bookend the workflow: cloning the repository, importing the skills the agent can use, and setting up the working branch at the start; publishing the merge request and making the generated artifacts available at the end. In between is the agentic execution itself, running GPT‑5.6 Luna inside the sandbox.

“It’s a combination of those two things: deterministic steps and agentic execution within the workflow.”

The sandbox runs Ubuntu and includes the toolchains iFood’s ecosystem requires—Python, Java, Kotlin, C#, TypeScript, Rust, JavaScript, and Go—along with general-purpose tools. Beyond the sandbox, the agent can access Nexus, GitLab, Docker, Snyk, Kubernetes, and AWS.

The model choice came down to three factors considered together, rather than just one.

“We chose GPT‑5.6 Luna because, among models at the same checkpoint, the benchmarks showed it offered a great balance of intelligence, efficiency, and execution speed—how quickly it could complete tasks. Those three qualities together led us to choose GPT‑5.6 Luna.”

That balance matters more for a platform built to scale than it would for a one-off use case. With tens of thousands of tokens being consumed, the average cost of four U.S. cents per run stops being a minor detail and becomes an architectural consideration.

“Given our plans to scale the platform across many use cases at iFood, the balance of efficiency and intelligence that OpenAI’s model provides ensures we can scale sustainably.”

—Victor Coelho, Senior Software Engineer, iFood

Delegating execution at scale creates a new challenge: automatically determining whether the agent did what it was supposed to do.

iFood’s answer comes in the step after the session. Once execution is complete, the result is processed using OpenAI’s Structured Outputs, which requires the output to conform to a predefined contract.

“We process the result using Structured Outputs, which ensures the response follows a predefined contract. From the agent’s session, we can identify the outputs within the response structure we expect. This helps reduce uncertainty and ensures we can always get a response from the agent’s session, whether positive or negative.”

—Victor Coelho, Senior Software Engineer, iFood

The platform already powers an internal iFood security product that scans the 15,000 repositories for vulnerable dependencies and attempts to fix them.

The migration had a direct impact: “With our platform, the accuracy of those changes, those fixes, more than doubled,” says Coelho.

This use case illustrates the idea behind the platform: the security team didn’t need to build its own agentic runtime or become experts in agent orchestration. It needed to call an API.

The team emphasizes what asynchronous execution frees developers to do, rather than replacement.

Because the task is delegated and runs without supervision, the developer doesn’t have to stay focused on monitoring it.

“While they’re in a meeting, they can launch a code fix, a performance analysis, or another task that’s a little more routine—something they can delegate without having to monitor it at that moment.”

Routine work no longer competes for the team’s attention. That leaves time for problems that require judgment.

“You can unlock those productivity gains without necessarily having to monitor the work as it happens.”

—Victor Coelho, Senior Software Engineer, iFood

The Remote Agents Platform was designed as an internal layer with similarities to the way OpenAI makes this type of task available to external customers.

“The Remote Agents Platform drew a lot of inspiration from OpenAI’s APIs, both the Batch API and the Agents API, which is an even more recent OpenAI product. We built a platform that resembles those products, but is internal to iFood.”

The inspiration went beyond the concept. It extends to the design of the interfaces, the organization of resources, and the approach to asynchronous execution with results retrieved later.

“These products directly inspired how we built our solution.”

—Victor Coelho, Senior Software Engineer, iFood

The platform has completed more than 25,000 tasks, consuming more than 27 billion tokens, at an average cost of US$0.04 per run.

After migrating to the Remote Agents Platform, the internal security platform more than doubled both the accuracy of its fixes and the number of vulnerabilities resolved.

Coverage extends across iFood’s more than 15,000 code repositories.

All runs use GPT‑5.6 Luna, chosen for its balance of intelligence, efficiency, and speed.

Structured Outputs ensures that each session returns a result that follows a predefined contract, whether positive or negative.

Product teams have moved from building fragmented solutions to delegating agentic execution through a REST API.

The bottleneck is often the runtime, not the use case. Several teams already knew what they wanted to automate; they lacked an environment in which to run it.

Combine deterministic steps with agentic execution. Cloning, publishing, and making artifacts available don’t require a model; the complex task in between does.

Treat cost per run as an architectural decision. At scale, the cost per task determines what is feasible to automate.

Require outputs to follow a contract. Without a structured response, there’s no way to know at scale whether the agent achieved its objective.

Asynchronous execution is the real productivity gain. The value lies in not having to monitor the work, rather than completing it faster while watching over it.

Expose agentic capabilities through an internal API so other teams can use them without rebuilding the infrastructure.

Isolate each run in its own sandbox, with your ecosystem’s toolchains already installed.

Choose a model by considering intelligence, cost, and speed together, rather than a single benchmark.

Use structured outputs to classify success and failure automatically.

Start with an internal user with a clear pain point and high volume—at iFood, that was the security platform.

The team plans to bring the platform to many more use cases across iFood, expanding the range of internal products that delegate agentic execution to it—with cost per task determining whether that expansion can be sustained.

Join the new era of work

More than 1 million businesses around the world are achieving meaningful results with OpenAI.

oai Cisco 1x1

Cisco and OpenAI redefine enterprise engineering with Codex

Rakuten fixes issues twice as fast with Codex

How Endava builds an agentic organization with Codex

原文为英文,正文由自动抓取并保留原文。

本文由采集器自动同步

原文发布于 OpenAI Blog(How iFood scales coding agents across 15,000 repositories),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗