OctSum
00:00 / 27:09

OpenAI · 27:09

Speaker 0

Hi, I'm Frey, and I work on engineering acceleration at OpenAI, helping our engineers and researchers keep shipping.

大家好,我是Frey,我在OpenAI负责工程加速工作,帮助我们的工程师和研究人员持续交付成果。

Speaker 1

And I'm VV, I work on the developer experience team at OpenAI. I spend a lot of my time experimenting with the latest models and seeing how far I can push them, um, just in general, right? Um, lately, that's meant building 3D worlds with Codex and Astra. So I am a huge Formula One fan and I want to see if Astra could help me explore an F1 car in 3D. So and really what I wanted to do was to just learn what these cars are made of, what are the components within this and just see what they're composed of. So I ran Codex with Astra on a remote machine and asked it to set itself a goal. the goal was very simple, build a ferrari and a website where i could explore all that it's made of. what you see on the screen is a small video or a small snippet of what codex built. i gave codex a few reference photos of the ferrari itself and worked with it over a few days until it got the 3d model right. And what's sort of incredible is that all of this was made by just seven pictures. What blew my mind in in all of this was astra unprompted essentially built not only the 3d version and the rendition of this but also a clay version and the wireframe version that you see on the screen as well. And, this sort of brought me to the next project, which i'm just going to show you, which was to build a fly through of one of my favorite race tracks, which is the nurburgring. again, i tasked codex with literally just the name of the track to go out, build a fly-through, and find its own way around it. here's what it made. what you see is 100% something that does not exist in the sense that this video does not exist. this is all created just by codex by looking at references online and so on and so forth. So, Codex set out with this goal to build this Grand Prix circuit. And when it started, it decided not to make the short version, but the longer, Nordschleife version. That's 21 kilometers. This entire video is 21 kilometers of down to all 70 turns of the circuit itself. And just for context, this track is three times bigger than your average formula one circuit track. so this took a little over two days. and most of the time went into rendering the frame itself and, you know, codex sort of like just waiting for blender to do its thing. codex used sub-agents to help out research the track, you know, figure out whether the geometry is correct or not. and really just like plan the render itself, right? what's interesting here is that because this is a really compute-intensive render, codex stopped a few times. this was because of ram issues, cpu overheating, and all the things that could go wrong. what was best about this was codex automatically picked up from where these saved frames were and kept going for these two days. Now, I pointed Codex and Astra for these F1 questions out of my own personal interest, but there's so much more you can accomplish in your day-to-day. Um, and all of this really to say that we're clearly at a point where agents, when given the right outcome, can keep working for a really long time. Frey, can you walk us through this journey so far?

我是VV,在OpenAI的开发者体验团队工作。 我大部分时间都在体验最新的模型,看看能把它们推到多远,嗯,总的来说,对吧? 嗯,最近这意味着用Codex和Astra构建3D世界。 我是一级方程式赛车的狂热粉丝,所以我想看看Astra能不能帮我以3D形式探索一辆F1赛车。 嗯,我真正想做的,其实只是了解这些赛车是由什么构成的,里面有哪些组件,看看它们都由哪些部分组成。 所以我在一台远程机器上用Codex搭配Astra运行,并让它自己设定一个目标。 这个目标非常简单:打造一辆法拉利,以及一个网站,让我能探索它的全部构造。 你们在屏幕上看到的是Codex所构建成果的一小段视频。 我给了Codex几张法拉利的参考照片,然后和它合作了几天,直到它把3D模型做对为止。 真正令人惊叹的是,这一切仅用了七张图片就完成了。 让我大为震撼的是,Astra在没有任何提示的情况下,基本上不仅构建了3D版本和渲染效果,还做出了粘土质感的版本,以及屏幕上你们看到的线框版本。 这也引出了我的下一个项目,我接下来就给大家展示,那就是制作我最喜欢的赛道之一——纽伯格林赛道的飞越视频。 同样,我只给Codex一个赛道名称,让它去搜集资料、构建飞越视频,并自己找到绕赛道的路线。 下面是它做出的成果。 你们看到的东西百分之百是不存在的,也就是说,这段视频本身并不存在。 这一切完全是Codex通过查阅网上的参考资料等等方式独立创建出来的。 于是,Codex朝着这个目标开始构建这条大奖赛赛道。 一开始,它决定不做短版本,而是做更长的北环版本(Nordschleife)。 全长21公里。 整个视频长达21公里,涵盖赛道上的全部70个弯道。 补充一下背景,这条赛道的规模是普通一级方程式赛道的三倍。 所以这项工作花了两天多一点的时间。 大部分时间都花在渲染画面上,还有,你知道的,Codex基本上是在等Blender完成它的工作。 Codex使用了子代理来帮忙研究赛道,弄清几何结构是否正确。 并且基本上还负责规划整个渲染过程,对吧? 有意思的是,因为这是一个计算量非常大的渲染,Codex停了好几次。 原因包括内存问题、CPU过热,以及各种可能出错的情况。 最好的一点是,Codex会自动从已保存帧的位置接着继续,坚持完成了这两天的工作。 我让Codex和Astra处理这些F1问题,纯粹出于我个人的兴趣,但在你的日常工作中,它们还能完成更多事情。 嗯,我想说的是,我们显然已经到了这样一个阶段:只要给出正确的目标,智能体就能持续工作很长时间。 Frey,你能带我们回顾一下到目前为止的这段历程吗?

Speaker 0

Absolutely, VB. If you were here last year on this very stage, I talked about exact plans, a skill for Codex to make it run for long periods of time on hard problems. Back then, making Codex run for seven hours felt like a big deal. I guess today you can just unprompted make it run for several days to build a F1 circuit. What you're seeing here is the prompt that I had last year, and you'll notice that it's actually too big to fit. We had to split it up. It's really long. There's a lot of prescriptive guidance in here. I'm giving it a code sample. I'm telling it what libraries to use and how to go about implementing things, and then still I'm telling it to produce a plan that I can interrogate and go back and forth with before I have it start working. I was a lot less comfortable with giving the model then a goal and trade offs and having it just start working. Today with Aspern Sol, I'm much more comfortable just telling it specifically that I tell it the goal and the outcome I want, what I care about, what are the trade-offs that I'm concerned with, and then I tell it it can figure out the steps. I can tell it how I know when the work will be good and let it just start working. I don't feel like I need to tell it half of the plan at the start. I don't feel like I need to go back and forth with it. And that gave me that got me thinking about what kind of jobs I can give it today, and especially the kind that requires constant manual supervision. It takes time out of my day. I wondered what could our models do this year and how long could they work today.

当然,VB。 如果你去年也在这个舞台上,我讲过具体的计划,这是一项让Codex在难题上长时间运行的技能。 当时,让Codex运行七个小时就已经是一件大事了。 今天,你不需要额外提示,就能让它连续运行好几天来搭建一条F1赛道。 你现在看到的是我去年用的提示词,你会发现它太长,放不进一个输入框,所以我们只好把它拆分开。 我们只好把它拆分开。 它真的很长。 里面有大量规定性的指导内容。 我会给它一个代码示例。 我会告诉它该使用哪些库,以及如何实现各项功能,但即便如此,我仍会要求它先制定一个计划,让我可以质询、与它来回讨论,然后再让它开始工作。 以前,我很不愿意只给模型一个目标和权衡取舍,然后就让它直接开始工作。 如今使用Aspern Sol时,我就舒服多了。我会具体告诉它我想要的目标和结果、我最在意什么、我所关注的权衡取舍是什么,然后告诉它可以自己确定步骤。 我会告诉它我如何判断工作成果是否合格,然后就让它直接开始工作。 我不觉得需要在一开始就把计划的一半告诉它。 我也不觉得需要与它反复来回沟通。 这让我开始思考,如今可以交给它哪些类型的工作,尤其是那些需要持续人工监督的工作。 这类工作会占用我大量的时间。 我想知道今年我们的模型能做到什么程度,以及它们如今能够连续工作多长时间。

The answer is over six weeks, that's over one thousand hours. One of my team's jobs is keeping continuous integration or CI healthy across all of OpenAI. CI runs automated tests on changes that engineers and researchers can tell whether their code can merge and they can ship. Now a test can fail legitimately because it's broken code, but often it will fail one time and pass the next. That's a flaky test. Someone then has to look at that and determine what the cause is, what kind of failure they're looking at, and the trickiest of these can take hours or days to debug. Meanwhile, another one comes in, someone on my team has to go look at it, or someone else has to debug it. And if you've ever worked on a team like this, you know that this just keeps recurring. I wanted to see if an agent could pick this up for me without me having to ask it every time. this agent ran for six weeks before i shut it down and not for any reason like it wasn't working. it was actually because my colleagues had started running agents of their own to do the same work. The starting prompt for this agent was only 200 words. What changed from last year? Well, I'm still giving it some ground rules of how I want it to work. Like, here's our repo. I want you, but I'm telling it like, you figure out how to run tests. You figure out how to run our entire suite. And I'm going to tell it then some rules about how I want it to message my colleagues and how to use CI resources effectively. There's no code here. I'm not prescribing how it needs to fix anything. And so this allows it to keep working and do this iterative loop of solving CI problems all on its own. For this run, I started with 5.6 Sol. At first, Sol did everything in one thread. It investigated the failures and it wrote the fixes itself. But I did notice that sometimes it would get bogged down in one particularly difficult problem, and then it would work on that for a long period of time while other flakes and issues were coming in. So about four days in, I interrupted it and I said, actually let your sub agents do that busy work. this was a paradigm shift for how productive it could be. the main thread was then taking care of triggering the tests and collecting the information about what was failing, and then organizing sub-agents and threads and messaging people. the sub-agents did that slow work of pulling down code, working on a particular failure, iterating, pushing back up to ci and making sure that it passed or sometimes failed and repeating when it needed to. Last year at Dev Day, I joked that I'd kind of become a manager of agents, and this year I've been promoted to a director of agents.

答案是超过六周,也就是一千多个小时。 我团队的一项工作,是保持OpenAI全公司持续集成(CI)的健康运行。 CI会对工程师和研究人员提交的变更运行自动化测试,由此判断他们的代码能否合并并发布。 测试失败可能是因为代码确实有问题,但也常常出现这样的情况:某个测试这次失败,下次又通过了。 这就是所谓的不稳定测试(flaky test)。 之后必须有人去查看,找出原因,判断属于哪种失败,而其中最棘手的情况可能要花数小时甚至数天去调试。 与此同时,又会有新的问题进来,我团队里的人必须去处理,或者由其他人来调试。 如果你曾在这样的团队工作过,就会知道这种情况会不断反复出现。 我想看看,智能体能否在我每次都无需提出要求的情况下,自行接手这项工作。 这个智能体运行了六周才被我关闭,并非因为它无法正常工作。 其实是因为我的同事们也开始运行自己的智能体,来做同样的工作。 这个智能体的初始提示只有200个字。 和去年相比有什么变化? 嗯,我仍然会给它一些基本规则,说明我希望它如何工作。 比如,这是我们的代码仓库。 我想让你,我是这样告诉它的:你自己想办法运行测试。 你自己想办法运行我们的整个测试套件。 然后我还会告诉它一些规则,说明我希望它如何与同事沟通,以及如何有效地使用CI资源。 这里没有代码。 我不会规定它该如何修复任何问题。 因此,这让它能够持续工作,并自行完成解决CI问题的迭代循环。 这次运行,我一开始用的是5.6 Sol。 起初,Sol在一个线程里完成了所有工作。 它排查失败原因,并自己编写修复代码。 但我注意到,有时它会陷入某个特别困难的问题,然后长时间专注于此,而其他不稳定的测试和问题则不断涌入。 所以大约四天后,我打断了它,并说:实际上,让你的子智能体去处理这些琐碎的繁忙工作。 这对于它能提升多少效率来说,是一次范式转变。 主线程随后负责触发测试、收集失败信息,然后组织子智能体和线程,并与相关人员沟通。 子智能体则负责那些耗时的工作:拉取代码、处理某个具体失败、反复迭代、推送回CI,并确保测试通过,或在失败时在需要时重复这一过程。 去年在Dev Day上,我开玩笑说自己已经成了智能体的经理,而今年我已被提升为智能体总监。

I give an agent a job, and then it manages a team of agents to get it done for me. the outcomes here are pretty incredible. over the six weeks that it ran, it opened more than 100 pull requests per week. Across the run merged more, it pushed more than 1,000 commits and it sent more than 600 messages to coworkers on Slack to coordinate, not just telling them what to do, but actually coordinate on landing these fixes. and in total merged more than 213 of its own fixes for those that it didn't merge. it often found that actually someone else had already produced a similar change and it prioritized their work ahead of its own. the agent recognized my role too and even did a good job of managing up. I did a retrospective with the agent after the run, and while it didn't say anything directly about my managing style, it did say that it was most productive for a five day stretch when I didn't message it once.

我给一个智能体安排一项任务,然后它会管理一支智能体团队来替我完成。 这里的成果相当惊人。 在它运行的六周里,每周提交了超过100个拉取请求。 在整个运行期间,它合并的内容更多,推送了超过1,000次提交,并在Slack上向同事发送了超过600条消息进行协调,不只是告诉他们该做什么,而是真正协调如何让这些修复落地。 总体而言,它合并了超过213个自己的修复;对于没有被合并的那些,情况也各不相同。 它经常发现其他人其实已经做出了类似的改动,于是把别人的工作排在自己的前面。 这个智能体也认识到了我的角色,甚至很好地做到了向上管理。 运行结束后,我和这个智能体做了一次复盘。虽然它没有直接谈论我的管理风格,但它确实说过,在连续五天里我一条消息都没给它发时,它的效率最高。

Over those 1,000 hours, the agent made just under half a million tool calls. That's roughly how many steps that it took, and it used more than 5,800 sub-agent sessions. Over 67,000 of those calls were just waiting for things to happen. And if you've ever worked on CI systems, you've ever had to bug issues like this, you know how this works. You pull down the code, you push up a change, maybe you go get a coffee or a snack because it's going to take a little bit. and then you come back, the agent here was tireless, he was able to keep working on this and then pause and wait for something to happen and then work on the next step when it came in. and a couple hundred fixed to see, i might not sound like a lot, but keep in mind this was these were the hardest bugs that were remaining open after many, many other humans and their agents were looking at these problems, maybe encountering them on their changes and deciding actually rather than fix this, it's easier for me to skip or retry that test. As an example, one of the hardest bugs that we had to fix with that this agent fixed was a Heisenbug, a non-deterministic error in the floating point calculations of one of our GPU tests. Now this is really well out of my wheelhouse. Um, I really had to spend a lot of time reading this thread and following up on figuring out exactly what happened. Um, it was really impressive. The agent reproduced this and correlated logs over weeks in order to find actually there was a particular node that this happened on. And it then taught itself how to run the test repeatedly on that node. This actually took several days for the subagent to debug. So it taught itself how to run this test on this node repeatedly. And it was able to reproduce this, but not 100% intermittently. And then this was the most impressive part. It actually reached out to researchers that owned this system, and it started a collaboration with them, describing what the problem was and how it reproduced the bug. and asking them questions, you know, is this a software optimization that maybe wasn't in scope, wasn't declared in the repo, but maybe part of that machine? Or was this a hardware issue? Maybe there was actually a faulty GPU. It was really impressive that I was able to do this and was able to solve this problem. Of course, sometimes this idea of getting back to green is just to delete the failing test, right? And sometimes that's right. But we often have reasonable skepticism when we want to just delete a test, right? That's the easy way of getting things to pass. When the agent noticed that it was not sure about whether that was the right solution, it often created another agent to interrogate and review the first agent's code, make sure that it was the right solution before asking a human to review it. and codex giving me this time back allowed me to focus on scaling our infrastructure.

在这1,000个小时里,这个智能体进行了将近五十万次工具调用。 这大致就是它所执行的步骤数,它还使用了超过5,800个子智能体会话。 其中超过67,000次调用只是在等待事情发生。 如果你曾经做过CI系统,曾经不得不处理这类问题,你就知道这是怎么回事。 你拉取代码,推送一次改动,也许去买杯咖啡或拿点零食,因为这需要一点时间。 然后你回来,这里的智能体始终不知疲倦,它能持续工作,在需要等待某件事发生时暂停,等结果出来后再进行下一步。 修复了几百个问题。听起来可能不算多,但要记住,这些都是在许多其他人类及其智能体反复审视这些问题之后仍然遗留下来的最难的bug。那些人可能在自己的改动中遇到了它们,然后判断与其修复,不如跳过或重试那个测试更省事。 举个例子,我们必须修复的最难的bug之一,被这个智能体修复了:一个海森bug,即我们某个GPU测试的浮点计算中出现的非确定性错误。 这确实远远超出了我的专业范围。 嗯,我确实花了很多时间阅读这个讨论串,并跟进弄清楚到底发生了什么。 嗯,它真的很令人印象深刻。 智能体复现了这个问题,并花了数周时间关联日志,最终找出这个问题实际发生在某一个特定节点上。 然后它自己学会了如何在那个节点上反复运行测试。 这实际上让子代理花了好几天时间来调试。 于是它自己学会了如何在这个节点上反复运行这个测试。 它能够复现这个问题,但并非百分之百间歇性出现。 然后,这是最令人印象深刻的部分。 它实际上主动联系了负责这个系统的研究人员,并与他们展开合作,描述了问题所在以及如何复现这个漏洞。 并向他们提出问题,比如:这是不是一个可能不在范围内、没有在代码仓库中声明、但可能属于那台机器一部分的软件优化? 还是说这是一个硬件问题? 也许其实是一块有故障的GPU。 我能够做到这一点并解决这个问题,真的非常令人印象深刻。 当然,有时候让测试恢复通过(变绿)的办法,就是直接删除失败的测试,对吧? 有时候这样做也是对的。 但当我们想直接删除一个测试时,我们通常会保持合理的怀疑,对吧? 那是让测试通过的捷径。 当代理注意到自己不确定这是否是正确的解决方案时,它经常会创建另一个代理,来审问和审查第一个代理的代码,确保这是正确的解决方案,然后才请人类来审查。 而Codex为我节省的这些时间,让我能够专注于扩展我们的基础设施。

this gave me back hundreds of hours of my time over the summer. and obviously codex can work for a thousand hours a day, so vb, can you walk us through the features in codex that enabled this?

这在整个夏天为我节省了数百个小时。 显然Codex一天可以工作一千个小时,所以vb,你能带我们了解一下使这一切成为可能的Codex功能吗?

Speaker 1

sure. so, first of all, one of the things that frill didn't mention is that his agent was called frillbot, which i find very cool and cute as well. and, you know, so frill walked us through a bunch of things that his agent did, and also through, you know, quite literally hundreds and thousands of commits, pull requests, and so on. but if we were to sort of summarize all the features that you require within codex to get you to that state, It's these six, and what we're going to do in the next couple of slides is essentially just like talk through those, and hopefully by the end of this, like you would have an understanding of how you can set up agents that can run for that long as well.

好的。 首先,Frill没有提到的一点是,他的代理被称为frillbot,我也觉得这很酷,也很可爱。 嗯,所以 frill 带我们过了一遍他的 agent 做过的很多事情,还有,你知道的,实实在在地看了几百上千个 commit、pull request 等等。 但如果我们要把你在 Codex 中达到那种状态所需的所有功能总结一下,就是这六个。接下来几张幻灯片基本上就是逐一讲解,希望讲完之后,你能理解如何设置能运行这么久的 agent。

So number one, use one thread for each outcome that you want to accomplish. So this is where like within this thread you can iterate, build up a plan with Codex and and really just you know like check in on like how Codex is doing at that particular job. You can you can even ask Codex to work towards it in a certain specific direction or even just like change directions as it goes as well. some of us are slash goal enjoyers over here. so for those of you, you can even use slash goal and tell codex to relentlessly go after that task and not stop until it is completed, no matter what happens. now let's take frails example. if i was to set up a thread for that, i would say something like, hey, keep an eye on the ci, reproduce these failing tests, Propose fixes and you know what, open a PR for both Trail and me to review. This gives Codex an outcome which is to fix and like you know keep an eye on the CI. It also gives it a way to check in on its work, which is the tests. And you know we've overall figured out a way for Codex to run those tests as well as make a change, run it again, figure out what it needs to do. Next up, you can further contextualize these long-running tasks using agents. md. Agents. md would look something like this for the CI project. You've got some sort of an understanding of where these tests are, what are some do's for your agents, and hey, what are some things which are completely off limits. And this is something which I recommend to everyone. to continuously sort of maintain as you sort of work through your project. now, one of the things or like one tip that i always add to my agents. md is to ask codex to keep notes of what it has done so far and also for what is still left to explore. so in case of scenarios wherein codex cannot continue the work as it happens, Corex can still sort of like read from that work log and go back to it. Now at this point you must be wondering, you're using one thread for such a long task, wouldn't that result in context rot or you know degraded model outputs? And this is where compaction comes in. Compaction allows our models to run for really long horizon tasks without losing track of context. A lot of the times I would joke about saying that compaction is a solved problem, which means that long horizon task is a solved problem. And you know, I mean this in the in the most strictest sense that I've got threads which are running for three months, and I'm sure like Fray's got bunch which are running for that long as well. So you can quite literally have endless conversations without worrying about the output itself, and just to make it clear, you do not need to change anything in your default codex behavior to have this compaction. This is built in.

所以第一条:每个你想完成的目标,使用一个线程。 也就是说,在这个线程里你可以反复迭代,和 Codex 一起制定计划,并且随时查看 Codex 在这项任务上的进展。 你甚至可以让 Codex 朝某个特定方向努力,或者在过程中直接改变方向。 我们这里有些人是 slash goal 的爱好者。 所以对于你们中的那些人,你甚至可以使用 slash goal,告诉 Codex 无论发生什么都要坚持不懈地完成那个任务,直到完成为止。 现在我们以 frail 的例子来说。 如果我要为它设置一个线程,我会说类似这样的话:嘿,留意一下 CI,复现这些失败的测试,提出修复方案,然后,你知道吗,为 Trail 和我各开一个 PR 供我们审阅。 这给了 Codex 一个目标,即修复问题并持续关注 CI。 它还提供了一种检查自身工作的方式,也就是测试。 而且总的来说,我们已经找到了让 Codex 运行这些测试、进行修改、再次运行、弄清楚还需要做什么的方法。 接下来,你可以使用 agents 进一步为这些长时间运行的任务提供上下文。 md。 Agents。 AGENTS.md 对于 CI 项目来说大致会是这样。 你需要对这些测试在哪里有一定了解,哪些事情是给你的 agent 的“应该做”,还有哪些事情是完全禁止的。 这是我向每个人推荐的做法, 在你推进项目的过程中持续地维护它。 好,我每次都会在我的 agents 里加入的一个技巧是: md 的作用是让 Codex 记录它目前已经完成的工作,以及仍需探索的内容。 这样,如果 Codex 在工作过程中无法继续,它仍然可以读取这份工作日志,回到之前的进度。 现在你可能在想,一个线程要完成这么长的任务,会不会导致上下文腐化,或者说模型输出质量下降? 这时就需要用到压缩(compaction)。 压缩让我们的模型能够运行超长时程的任务,同时不丢失上下文。 我经常开玩笑说,压缩已经是个解决了的问题,这也就意味着长时程任务已经解决了。 我的意思是最严格意义上的解决:我有些线程已经运行了三个月,我相信 Fray 也有一批运行了同样长时间的线程。 所以你几乎可以进行无尽的对话,而不必担心输出本身的质量。需要明确的是,你不需要更改 Codex 的任何默认行为就能使用这种压缩功能。 这是内置的。

Now, running long horizon tasks on your laptop can be a little inconvenient. Imagine frail having to keep a fleet of laptops plugged in for six weeks straight. This is where remote environments come in. They allow your threats to continue working without without having to have a laptop plugged in 24/7 with codex. You can connect remote machines over ssh across desktop. mobile as well as web. and that allows these threads to run on this virtual machine with the files, the context, the git repos, and the tools that it has access to. for the racetrack example, i used a dev server. that dev server had blender. it also had some relevant project files. it also had access to web search, so it could pull in resources as it needed. and codex was good to go. for quite literally a couple days. and starting today, you can also use our new and improved codex cloud experience as well. you get the full codex agent with a powerful virtual machine without the need to manage the machine yourself. the environment is snapshotted, which means in case you come back to a task after a couple days or even weeks, you can come back to it. It also refreshes the checked out code dependencies periodically to make sure that your task work the way that they do. In fact, fun fact today, for all the stuff that we launched, I was actually merging those PR from the backstage. We are Codex Cloud, so it does work. it also works across the three surfaces that i mentioned before, which is desktop, mobile and web. and the best part is you can bring in all of your codex plugins as you use directly in it as well. Speaking of plugins, now that Codex has somewhere to run, it's got either a VM or Codex Cloud and so on. You do want to make sure that Codex has the full picture of what it's trying to do. Going back to Frey's example, let's say there is a test that is failing. Now, there might already be a GitHub issue for it, or there might be that the teammates are already discussing that on Slack. now, codex can continue sort of working on that problem, but it would just be mindlessly running around like a headless chicken if it didn't know what is happening. and this is where plugins come in. you can connect plugins like github, linear, and really just give codex access to tools that you work with so that it can search through issues, discussions, pull requests, and so on. I am a huge believer that plugins is the way to accelerate the most that you get out of Codex.

现在,在笔记本电脑上运行长时程任务可能会有些不方便。 想象一下 Fray 要让一整队笔记本电脑连续六周都插着电源。 这时就需要远程环境了。 它们让你的线程无需笔记本电脑 24/7 插着电、运行 Codex,也能继续工作。 你可以通过 SSH 连接远程机器,支持桌面端。 移动端和网页端同样支持。 这样,线程就可以在这台虚拟机上运行,访问其中的文件、上下文、Git 仓库以及它有权限使用的工具。 在赛道示例中,我使用的是一台开发服务器。 这台开发服务器上装有 Blender。 它还包含一些相关的项目文件。 它还可以访问网络搜索,因此需要时可以获取所需资料。 而且Codex已经完全可以投入使用了。 几乎就是字面意义上的只用了几天。 从今天开始,你还可以使用我们全新升级的Codex云端体验。 你可以获得完整的Codex智能体,搭配强大的虚拟机,而且无需自己管理机器。 环境会被快照保存,这意味着即使你几天甚至几周后才回来处理某个任务,也能接着继续。 它还会定期刷新检出的代码和依赖项,确保你的任务能按照它们原本的方式运行。 其实,有个有趣的小事实:今天为了发布的所有内容,我其实是在后台合并那些PR。 我们就是Codex Cloud,所以它确实能用。 它还能在我之前提到的三个平台上运行,分别是桌面端、移动端和网页端。 最棒的是,你还可以把所有Codex插件直接带进来使用。 说到插件,既然Codex现在有了运行的地方,无论是虚拟机还是Codex Cloud等等,它就需要插件。 你确实需要确保Codex full掌握它要做的事情的全貌。 回到Frey的例子,假设有一个测试失败了。 现在,可能已经有一个针对它的GitHub issue,或者团队成员已经在Slack上讨论这个问题了。 现在,Codex可以继续处理这个问题,但如果它不知道发生了什么,就只会像无头苍蝇一样乱跑。 这就是插件发挥作用的地方。 你可以连接GitHub、Linear等插件,让Codex能够访问你日常使用的工具,从而搜索issue、讨论、拉取请求等内容。 我坚信,插件是让你从Codex中获得最大收益的最快途径。

no. When you give Codex a big job, there might be a few things it could work on at the same time. Like running a six-week-long task in just one single thread can be a little messy, especially over days. Take the Ferrari project for example. There is the Blender model, but there's also the website which needs to be built where you can sort of explore the model and so on and so forth. These two pieces do not need to be worked on sequentially. So what you could do is you could just ask Codex to split this task into child threads. The main thread can keep an eye over, you know, the main job. And you know, you can even open these individual threads and sort of give them direction or just ask them to stop or just really treat them as individual projects in itself as well. This is how it would typically look like on the Codex app UI as well. and if you're using a git repo, each thread or each of these child threads can have its own work tree. a work tree is a separate checkout of the code itself so that Codex sub-agents and the child threads can make changes without sort of messing around with one copy of your code. this is particularly useful as parallel threads. are working on different features together. It allows your codex agent to continue working faster and in a much more secure way as well. now, you might be wondering, how do you steer long-running tasks, especially like those which are running over a couple of days and even months and so on and so forth? this is where slash side comes in. slash side is a special form of child thread, which forks the entire context that your main thread has and allows you to ask questions without messing around with the main thread itself. i personally use both of these features over a dozen times a day. especially with worktrees, i can work on multiple projects and multiple features within a project without worrying about merge conflicts. and we all hate merge conflicts. now, while those threads are working, one of them might get stuck.

不。 当你交给Codex一个大任务时,可能有几件事它可以同时着手处理。 像在单一线程中运行一个为期六周的任务,尤其是跨越好几天时,可能会有些混乱。 以Ferrari项目为例。 既有Blender模型,还需要构建一个网站,让你可以大致浏览这个模型,诸如此类。 这两部分并不需要依次进行。 所以你可以做的是,让Codex把这项任务拆分到子线程中。 主线程可以持续关注整体的主要工作。 你还可以打开这些单独的线程,给它们下达指示,或者让它们停止,也可以把它们当作独立的项目来对待。 在Codex应用界面中,通常也是这样的呈现方式。 如果你使用的是git仓库,每个线程或每个子线程都可以拥有自己的工作树。 工作树是代码的一份独立检出副本,这样Codex子代理和子线程就可以进行修改,而不会干扰你那一份代码。 这对于并行线程特别有用。 它们同时处理不同的功能。 这让你的Codex代理能够更快地持续工作,同时也更加安全。 你可能会想,如何引导长时间运行的任务,尤其是那些要运行好几天甚至几个月的任务呢? 这就是/side的用武之地。 /side是一种特殊的子线程,它会复制主线程的全部上下文,让你可以提问,而不会干扰主线程本身。 我个人每天会用这两项功能十多次。 尤其是借助工作树,我可以同时处理多个项目,并在一个项目内同时推进多个功能,而不必担心合并冲突。 我们都讨厌合并冲突。 现在,当这些线程在工作时,其中一个可能会卡住。

maybe codex has tried a couple of approaches and still hasn't really figured out what exactly is going wrong. this is where ultra mode comes in. and i have to say, i personally love this visualization a lot. and codex can use ultra to give the model a lot of time to reason through the problem itself. it can also spin up sub-agents within that thread that could, you know, one of those sub-agents could go investigate the problem. one of them can try a potential fix or just, you know, really another one could just like think outside the box. and ultra gives codex the capability to sort of manage that all in a package itself. now, to draw parallels between having codex spin up child threads and having codex work on ultra, the main difference really is, or rather the way that i see it, is when i have a problem that's embarrassingly parallel, i would have codex use threads. Saya akan memisahkan tugas itu dan mengerjakan itu. Dan ketika saya menghadapi satu masalah yang sangat sulit, seperti masalah GPU yang Anda sebutkan dan masalah presisi titik mengambang, saya akan beralih ke Ultra. Now sometimes a job can get held up waiting for something that is outside its own control. This could be, let's say, I've opened a pull request or my codex has opened a pull request and it's waiting for frail to review. Now I have two options: one is that I can continue messaging frail on Slack to come back from his coffee break and review my PR, or I can just have codex. You know, set up a scheduled task and look at that for me. An example of this would be hey codex every half hour check for you know some sort of a review and see if there's a feedback if there is something that you can address address it if not then you know just carry on as usual and this is this is what is called a heartbeat. A heartbeat is a scheduled follow-up. within the same thread where codex can come back with the context of all the work it's done so far and all that it's done so far, what's changed, and really whatever needs to be done sort of next. You can also use scheduled tasks to set up a new task each time. A good example of this is give me a summary of all the projects that I've done or like everything that's happened, you know, in my project overnight or or really just, you know, give a weekly summary of different projects which I used to work on and don't work on now. You can just try a prompt, um, set it as how often you want it to run. And you will find it in the schedule tab on the Codex app. Now, Frey, you let all of this, all of these features run for six weeks. And I can imagine literally everyone in this room thinking right now that, hey, you work at OpenAI, you have infinite tokens.

也许 Codex 已经尝试了几种方法,但仍然没有真正弄清楚到底是哪里出了问题。 这时就该用到 Ultra 模式了。 我得说,我个人非常喜欢这个可视化效果。 Codex 可以使用 Ultra 模式,让模型有充足的时间自行推理问题。 它还可以在同一个线程中启动子代理,你知道的,其中一个子代理可以去调查问题。 其中一个可以尝试一种潜在的修复方案,或者,另一个可以跳出框架去思考。 Ultra 让 Codex 能够把这一切打包统一地管理起来。 那么,要把 Codex 启动子线程与 Codex 使用 Ultra 进行比较,主要区别在于(或者按我的理解来说),当我遇到一个可以高度并行化的问题时,我会让 Codex 使用线程。 我会把这个任务拆分开,然后处理它。 而当我遇到一个非常困难的问题时,比如你提到的 GPU 问题和浮点精度问题,我就会转而使用 Ultra。 现在,有时一个任务会因为等待某件超出其自身控制范围的事情而被卡住。 比如说,我开了一个拉取请求,或者我的 Codex 开了一个拉取请求,而它正在等待 Frail 审核。 这时我有两个选择:一是我可以继续在 Slack 上给 Frail 发消息,让他喝完咖啡回来审核我的 PR;二是我可以直接让 Codex。 你知道的,设置一个定时任务,替我去盯着这件事。 举个例子,比如你可以对 Codex 说:每半小时检查一次,看看有没有某种审核意见,如果有反馈,就处理它;如果没有,那就照常继续工作。这就是所谓的“心跳”。 心跳就是一种定时跟进。 它发生在同一个线程中,Codex 可以带着它到目前为止所做的全部工作的上下文回来,说明做了哪些改动,以及接下来真正需要做什么。 你也可以使用定时任务,每次都建立一个新任务。 一个很好的例子是:给我总结一下我做过的所有项目,或者总结一下我的项目在夜间发生的所有事情,或者干脆每周给我一份总结,列出我以前在做、现在已经不再做的各个项目。 你可以先试一个提示词,嗯,设置好你希望它运行的频率。 你可以在 Codex 应用的日程标签页中找到它。 现在,Frey,你让这些功能全部运行了六周。 我想现在房间里的每个人都在想:嘿,你在 OpenAI 工作,你有无限的 token。

And the rest of us surely can't afford that. So let's demystify that. Walk me through how much did it actually cost?

而我们其他人肯定负担不起。 所以我们来揭开这个谜团。 跟我们说说,这到底花了多少钱?

Speaker 0

It's a great question, Vivi. And of course, I and my manager were asking the same question. And it turned out we worked back from the pricing, and it worked out to about $32 an hour to have Codex running for six weeks fixing CI across all of OpenAI. But the GPT-6 sold last week, the price dropped to 16 dollars. GPT 6 stretches your token budget twice as far, and with 6.1 Sol, it's even more token efficient and competitive with Astra. And this was for an agent that was fixing bugs across systems all across OpenAI, getting CI green repeatedly, running millions of tests each time it ran its loop. It was well worth it to reduce friction for all of us. Of course, there's a lot more than just an agent that goes into fixing CI. There's code review, there's the CI resources themselves, there's other factors. But I do want to talk to you about how you can get started hiring Codex today. First find something that's taking up time and keeping you from doing the work that matters most to you. This could be going through your backlog, making PRs, maybe speculatively to implement features that are on the roadmap. It could be watching errors and exceptions and logs and making fixes for those, or it could be fixing CI like I did. You need to give the model a way that it can check its work and run in a loop. Do you have end to end tests that it can run either in Codex Cloud or on a dev box or on your laptop? And does it have some way to know when its work is done? With the GPT-6 models, I find that I can just tell them the trade-offs that I care about and the outcome that I'm looking for. And I let it delegate. I use Ultra for the hardest problems, but I also use Codex as an organizer. Like with your Formula One example, I use sections in the sidebar of the app, and I have it organize huge sections for me with hundreds of issues for me to look at. And I manage this as an inbox. I let it create these threads and let me know what needs my attention. and i set my ground rules, i tell it when it should escalate to me and needs my attention, or maybe even to ping an on call. and then finally i tell it how much i'm willing to spend, or in my case, how many ci jobs can it run at one time. so think back to the beginning and the thing you had in mind at the start. what could codex take off of your plate and what could you do with the time that it gives you back? thanks everyone have a great day.

这是个很好的问题,Vivi。 当然,我和我的经理也在问同样的问题。 我们从定价倒推计算,结果发现让 Codex 运行六周、修复整个 OpenAI 的 CI,大约需要每小时 32 美元。 但上周 GPT-6 发布后,价格降到了 16 美元。 GPT-6 让你的 token 预算多用一倍,而 6.1 Sol 的 token 效率更高,也更能与 Astra 竞争。 而这次运行的是一个跨 OpenAI 各个系统修复 bug 的智能体,反复让 CI 变绿,每次循环都要运行数百万次测试。 为了减少我们所有人的摩擦,这笔投入非常值得。 当然,修复 CI 不只是一个智能体的事,还涉及很多其他方面。 还有代码审查、CI 资源本身,以及其他因素。 但我确实想跟你们聊聊,你今天就可以如何开始雇用 Codex。 首先,找到那些占用你时间、让你无法做最重要工作的事情。 这可以是处理你的待办积压、提交 PR,或者可能是预先实现路线图上的功能。 也可以是监控错误、异常和日志并对其进行修复,或者像我一样修复 CI。 你需要给模型一种检查自身工作并循环运行的方式。 你们有没有端到端测试,能让它在 Codex Cloud、开发机或你的笔记本上运行? 那它有没有某种方式知道自己什么时候完成了工作? 用 GPT-6 模型时,我发现只要告诉它我在意的权衡取舍,以及我想要的结果就行。 然后我就让它自行分派任务。 最难的问题我用 Ultra 来解决,但我也把 Codex 当作组织者来用。 就像你的一级方程式例子那样,我在应用侧边栏里设置分区,让它替我整理出包含数百个问题的大型分区,供我查看。 我把这些当作收件箱来管理。 我让它创建这些线程,并告诉我哪些需要我关注。 我还会设定基本规则,告诉它什么时候应该升级并需要我介入,甚至什么时候应该呼叫值班人员。 最后,我会告诉它我愿意花多少钱,或者就我而言,告诉它同时最多可以运行多少个 CI 任务。 所以,回想一下最初的起点,回到你一开始心里所想的事情。 Codex 能替你分担哪些工作?而它为你节省下来的时间,你又能用来做什么? 谢谢大家,祝你们今天愉快。

Overview

本视频由 OpenAI 工程效率团队的 Frey 与开发者体验团队的 VV 主讲,围绕“如何让编程智能体长时间可靠地工作”展开。开场以 Codex 与 Astra 搭建 F1 赛车 3D 模型、用约 21 公里的纽北赛道飞越视频为例,展示其在无人逐步指导下连续运行两天以上的能力。随后 Frey 讲述自己的工作方式变化:从去年给出详细步骤、要求先出计划,转为只说明目标、取舍和验收标准,由智能体自行规划。他用 CI 修复任务作为案例,智能体连续运行六周、超过 1000 小时,发起百余个 PR 每周,合并 213 项修复,并借助子智能体并行处理。VV 随后梳理了支撑长时间运行的六项功能,包括单线程目标、AGENTS.md、上下文压缩、远程环境、插件、子线程与 Ultra,以及心跳和定时任务。最后两人给出成本估算和上手建议,强调任务需要可验证的反馈回路,以及人在关键节点保留决策权。

Chapters

00:19 长时间运行智能体的演示与背景

Frey 介绍自己负责工程加速,并以 Codex 搭配 Astra 制作 3D 内容为例。他先让智能体构建法拉利模型及可探索其结构的网站,仅依靠七张参考图完成三维模型,并自行生成了渲染版、黏土版和线框版。随后他只给出“纽北赛道”这一名称,智能体自行查找资料、规划路线,选择约 21 公里的完整北环赛道,包含 70 个弯,耗时两天多。过程中子智能体负责调研赛道几何、规划渲染;因内存、CPU 过热等问题中断数次,但每次都能从已保存的帧继续。演示表明,只要结果目标明确,智能体可以长时间持续工作。

演讲者开场介绍,作为本章起始锚点
章节代表画面
构建的法拉利3D模型与可探索网站
由七张参考图生成3D模型的依据
AI自动生成的黏土版与线框版模型对比

04:11 从详细指令到目标驱动的工作方式转变

Frey 回顾去年的做法:当时他为 Codex 编写了很长、需要拆分提交的提示词,包含大量规范指导、代码示例、指定库,并要求先产出可反复讨论的计划后再开始执行,当时让 Codex 连续运行七小时已被视为重要突破。今年他更倾向于只说明目标、期望结果、关注的取舍和验收方式,由模型自行决定步骤,无需提前规划半数步骤或反复往返确认。这一变化促使他思考:哪些需要持续人工监督的工作可以交给智能体,以及当前模型究竟能连续工作多久。他的答案是,在 CI 任务上可以连续运行超过六周,约 1000 小时。

Codex 连续运行数天构建的 F1 赛道成果
展示去年使用的超长提示词原文画面

05:46 CI 修复智能体的设置与子智能体分工

Frey 的团队负责维护 OpenAI 全公司的持续集成(CI)。测试偶发失败(flaky test)很常见,排查往往耗时数小时甚至数天,并不断重复出现。他设计的智能体提示词只有约 200 字,只说明代码仓库、要求其自行摸索如何运行全部测试、以及与同事沟通和使用 CI 资源的规则,不规定具体修复方法。智能体最初在单一线程中完成调查与修复,但遇到难题时会长时间卡住,其他问题堆积。约四天后,Frey 让它把重复性工作交给子智能体:主线程负责触发测试、汇总失败信息、组织子线程并与人沟通,子智能体负责拉取代码、修复单个失败、推送并重复验证。Frey 认为这一调整显著提升了效率。

六周运行时长的概览
CI 健康维护的工作范围
CI 自动化测试流程
测试偶发失败的现象
不稳定测试的定义

08:24 CI 智能体的运行成果与难题处理

在六周运行期间,该智能体每周开启超过 100 个 PR,共推送超过 1000 次提交,并向同事的 Slack 发送超过 600 条协调消息,共合并了 213 项自身修复。若发现他人已提交类似修复,它会优先采用对方的工作。运行后的复盘显示,智能体在连续五天未收到 Frey 任何消息时效率最高。整个运行过程共进行约 50 万次工具调用、超过 5800 次子智能体会话,其中超过 6.7 万次调用用于等待。它处理的是其他人与智能体反复遇到却未解决的问题,修复数量虽不算多,但多为难度较高的遗留问题。

智能体管理代理团队的工作方式
运行成果概览
每周提交的拉取请求数量
累计推送的提交数量
智能体自身合并的修复数量

09:22 疑难缺陷排查、测试删除与交叉审查

Frey 举例说明一个难题:GPU 测试中浮点计算的非确定性错误,即 Heisenbug。智能体通过数周的日志关联,定位到特定节点,自行学习在该节点上反复运行测试,并耗时数日复现问题,但复现率并非百分之百。随后它联系了相关系统的研究人员,询问是软件优化未声明的行为,还是硬件(如 GPU 故障)问题。对于“直接删除失败测试以恢复通过”的做法,智能体会先判断其是否正确;不确定时,会创建另一个智能体对代码进行审查,之后才交由人工复核。Frey 表示,这项工作为他节省了数百小时,使他能够专注于扩展基础设施。

1000小时内工具调用总量的统计数据
子代理会话数量的统计数据
等待类调用次数的统计数据
GPU测试中非确定性浮点计算错误的结果画面
删除失败测试的代码改动或操作画面

12:02 支撑长时间运行的六项功能概览

VV 说明,Codex 支撑这种长时间运行依靠六项功能,并逐一介绍。他先补充说,Frey 的智能体名为 FrenBot。这一部分概括了 Frey 运行过程中的关键操作,并为后续各项功能的讲解做铺垫。

讲者提到的六项功能概览画面,对应本章标题所示的六项功能

12:57 单线程目标、AGENTS.md 与上下文管理

第一项功能是为每个目标使用一个线程,在线程中逐步制定计划并检查进展,也可随时调整方向。对于需要持续推进的任务,还可使用 /goal 命令,要求 Codex 不断推进直至完成。以 CI 为例,提示可以写明持续关注 CI、复现失败测试、提出修复并为人工审查开 PR,同时给出可验证的测试作为检查依据。第二项是 AGENTS.md,用于记录测试位置、可做与禁止的事项,并需要持续维护。VV 还建议让 Codex 记录已完成的工作和待探索事项,便于中断后继续。关于上下文退化的问题,压缩(compaction)机制可让模型在长周期任务中保持上下文,无需修改默认设置。VV 称有线程已运行三个月。

斜杠命令 /goal 的使用界面
AGENTS.md 文件内容示例
长任务上下文压缩的说明画面

16:06 远程环境、Codex Cloud 与插件连接

长时间任务若依赖笔记本电脑持续在线并不现实,因此远程环境可以让线程在虚拟机上运行,通过 SSH、桌面、移动端和网页连接,并可访问文件、上下文、Git 仓库和工具。纽北视频的任务就是在一台开发服务器上运行,服务器装有 Blender、项目文件,并能联网搜索资料,连续运行了数天。Codex Cloud 现已提供完整的 Codex 智能体与虚拟机,免除自行管理机器的麻烦;环境会被快照保存,任务可在数天或数周后继续,依赖项也会定期刷新。它同时支持桌面、移动端和网页。关于插件,智能体需要了解完整背景,例如 GitHub 问题、Slack 讨论等,因此可连接 GitHub、Linear 等工具,让它检索问题、讨论和 PR。VV 认为插件是提升 Codex 效果的关键。

笔记本长时间运行任务的不便
需要保持多台笔记本持续插电
远程环境概念引入
远程环境无需笔记本持续插电
通过SSH连接远程机器

18:54 子线程、Worktree、/side 与 Ultra 模式

大型任务可拆分为多个子线程并行处理,例如 Ferrari 项目中的 Blender 模型与网站可以同时推进。主线��负责整体监督,用户也可直接进入子线程下达指令、要求停止或将其视为独立项目。若代码位于 Git 仓库中,每个子线程可拥有独立的 worktree,即代码的独立检出副本,避免相互修改同一份代码。这样可以在并行开发功能时减少冲突。/side 会分叉主线程的完整上下文,用于提问而不干扰主线程。VV 称自己每天使用这些功能十余次。当线程陷入僵局时,Ultra 模式会让模型进行更长时间的推理,并在线程中派生子智能体分别调查问题、尝试修复或另辟思路。VV 的区分是:可并行拆分的问题用子线程,高难度问题(如 GPU 与浮点问题)则使用 Ultra。

Ferrari 项目中的 Blender 模型
Codex 应用界面中子线程的典型展示
/side 功能的引入画面

21:13 心跳机制与定时任务

当任务被外部因素阻塞,例如 PR 等待人工审查,可以设置心跳(heartbeat):智能体每隔固定时间回到同一线程检查审查意见,若有反馈则处理,否则继续其他工作。定时任务则会在每次运行时启动新任务,例如汇总过去一夜的项目进展,或每周列出不再维护的项目。用户可在 Codex 应用的 schedule 标签中设置运行频率。VV 随后转向成本问题,提出普通用户可能无法承担 OpenAI 内部的大量 token 消耗。

Ultra模式的可视化界面
Codex应用中的定时任务标签页

24:14 六周运行成本与上手建议

Frey 根据定价倒推,这次六周持续运行 Codex 修复全公司 CI 的成本约为每小时 32 美元。上周 GPT-6 发布后价格降至每小时 16 美元,且 GPT-6 使 token 预算的使用效率约提高一倍;后续的 6.1 Sol 则更加节省 token。此次运行涉及跨系统修复、反复使 CI 变绿,并且每轮都要运行数百万次测试,Frey 认为这一投入对降低团队摩擦是值得的。另一方面,代码审查、CI 资源等也会产生额外成本。上手建议是:先找一件占用时间、阻碍重要工作的任务,并确保智能体能够通过端到端测试等方式检查结果、知道何时完成。Frey 自己还让 Codex 充当组织者,把数百个问题整理成收件箱,并预先设定何时升级给人、何时通知值班人员,以及可用的预算或并发 CI 任务数。

开场提到的成本门槛,无明确画面,以原文锚点代表本段
引出成本拆解,无明确画面,以原文锚点代表本段
提出成本问题,无明确画面,以原文锚点代表本段
口播回应问题,无明确画面,以原文锚点代表本段
说明团队关注同一成本问题,无明确画面,以原文锚点代表本段

Conclusions

03:59 只要任务目标、验收方式和取舍明确,编程智能体就可以在较少人工干预下长时间持续工作。

05:09 相比逐步给出详细计划,只说明目标、取舍与验收标准,更适合交给智能体长时间自主推进。

08:03 将重复性的排查与修复工作交给子智能体,主线程负责协调,能显著提高长时间任务的效率。

08:50 在六周运行中,CI 修复智能体合并了 213 项自身修复,并通过协调同事来推动这些修复落地。

25:43 智能体需要有可检查工作的方式(如测试)和判断何时完成的标准,才能形成可持续的迭代循环。

24:28 以约每小时 32 美元估算,六周持续运行修复 CI 的成本随着 GPT-6 降价而降至约每小时 16 美元。