長期間自律的なコーディングのスケーリング
本文の状態
日本語全文を表示中
詳細モードで約9分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Cursor Blog
研究チームが、数週間にわたって自律的に動作するコーディングエージェントの実験を実施し、長期間の自律コーディングの実現可能性を探っている。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
私たちは数週間、コーディングエージェントを自律的に実行する実験を行ってきました。
私たちの目標は、通常、人間チームが数ヶ月をかけて完了させるようなプロジェクトにおいて、アジェンティックコーディングのフロンティアをどこまで押し広げられるかを理解することです。
この投稿では、単一のプロジェクトに対して数百もの並列エージェントを実行し、その作業を調整し、100 万行を超えるコードと数兆トークンの生成を見守る中で得た教訓について説明します。
単一エージェントの限界
今日のエージェントは焦点を絞ったタスクではよく機能しますが、複雑なプロジェクトには時間がかかります。自然な次のステップは複数のエージェントを並列で実行することですが、それらをどのように調整するかを考えるのは困難です。
私たちの最初の直感は、事前計画があまりにも硬直的になるだろうということでした。大規模なプロジェクトにおける道筋は曖昧であり、作業の適切な分担も初期段階では明らかではありません。そこで私たちは、他のエージェントが現在何をしているかに基づいてエージェント自身が行動を決定する動的調整から始めました。
調整法の習得
私たちの最初の手法では、すべてのエージェントに同等の地位を与え、共有ファイルを通じて自己調整を行わせました。各エージェントは他者が何をしているかを確認し、タスクを引き受け、そのステータスを更新します。2 つのエージェントが同じタスクを奪い合うのを防ぐために、ロック機構を使用しました。
これは興味深い形で失敗しました:
エージェントがロックを必要以上に保持したり、完全に解放することを忘れたりしました。ロックが正しく機能していた場合でさえ、ボトルネックとなりました。20 台のエージェントが実行されても、実効スループットは 2〜3 台にまで低下し、時間の大部分が待ち時間に費やされました。
システムは脆かった:エージェントはロックを保持している間に失敗したり、すでに保持しているロックの取得を試みたり、ロックを取得せずに調整ファイルを更新したりすることがあった。
私たちはロックを楽観的並行制御(Optimistic Concurrency Control)に置き換えることを試みた。エージェントは状態を自由に読み取れるが、最後に読み取ってから状態が変更されていた場合、書き込みは失敗する。これはよりシンプルで堅牢だったが、依然として深い問題が残っていた。
階層構造がないため、エージェントはリスク回避的になった。困難なタスクを避け、代わりに小さく安全な変更を行うようになった。どのエージェントも難しい問題やエンドツーエンドの実装に対する責任を取らなかった。その結果、長い期間にわたって作業が循環するだけで進展が見られない状態となった。
#Planners and workers
次のアプローチは役割を分離することだった。すべてのエージェントが何でも行うフラットな構造ではなく、明確な責任を持つパイプラインを作成した。
プランナー(Planner)はコードベースを継続的に探索し、タスクを作成する。特定の領域に対してサブプランナーを生成することもでき、計画自体を並列かつ再帰的に行うことができる。
ワーカー(Worker)はタスクを引き受け、完了に完全に集中する。他のワーカーと調整したり、全体像について心配したりしない。割り当てられたタスクが完了し、変更をプッシュするまでひたすら作業を続けるのだ。
各サイクルの終了時、ジャッジエージェントが継続するか否かを判断し、次のイテレーションは新たに開始される。これにより、協調に関する問題のほとんどが解決され、単一のエージェントが視野狭窄に陥ることなく、非常に大規模なプロジェクトへのスケーリングが可能となった。
#Running for weeks
このシステムを検証するため、私たちは大胆な目標を提示しました:ゼロからウェブブラウザを構築することです。エージェントは約 1 週間稼働し、1,000 ファイルにわたって 100 万行以上のコードを書き上げました。ソースコードは GitHub で閲覧可能です。
コードベースの規模にかかわらず、新しいエージェントでもそれを理解し、意味のある進捗を遂げることができます。数百人のワーカーが並列で実行され、最小限の競合で同じブランチにプッシュされています。
単なるスクリーンショットに見えるかもしれませんが、ゼロからブラウザを構築するのは極めて困難です。
別の実験では、Cursor コードベース内で Solid から React へのインプレイス移行を行いました。これには 3 週間以上かかり、編集数は +266K/-193K に達しました。まだ慎重なレビューが必要ですが、CI(継続的インテグレーション)と初期チェックは通過しています。
別の実験では、近々リリースされる製品の改善を行いました。長時間稼働するエージェントが、効率的な Rust 版を実装することで動画レンダリングを 25 倍高速化しました。また、カーソルに追従しながら自然なスプリングトランジションとモーションブラーを用いてスムーズにズームおよびパン操作をサポートする機能も追加されました。このコードはマージされ、まもなく本番環境で利用可能になります。
他にもいくつか興味深い例が現在進行中です:
Java LSP: 7.4K コミット、550K LoC(行数)
Windows 7 エミュレータ:14.6K コミット、1.2M LoC
Excel: 12K コミット、1.6M LoC
私たちが学んだこと
私たちはこれらのエージェントに対して、単一の目標達成のために兆単位(トリリオン)のトークンを投入しました。システムは完璧に効率的ではありませんが、私たちが予想していたよりはるかに効果的です。
モデルの選択は、極めて長時間実行されるタスクにおいて重要です。GPT-5.2 モデルは、拡張された自律的な作業において、指示の遵守、集中力の維持、ドリフト(逸脱)の回避、そして物事を正確かつ完全に実装する点で、はるかに優れていることがわかりました。
Opus 4.5 は、都合が良いと判断した際に早期に停止し、近道を取って素早く制御を返す傾向があります。また、異なるモデルが異なる役割において卓越していることも発見しました。GPT-5.1-Codex がコーディングのために特別にトレーニングされているにもかかわらず、GPT-5.2 の方が GPT-5.1-Codex よりも優れたプランナーです。現在は、一つの汎用モデルを使用するのではなく、各役割に適した最適なモデルを採用しています。
多くの改善点は、複雑さを追加することではなく、それを排除することから生まれました。当初は品質管理と競合解決のための統合者(インテグレーター)の役割を構築しましたが、それが解決する問題よりもボトルネックを生み出すことがわかりました。ワーカーたちはすでに自分たちで競合を処理できる能力を持っていました。
最適なシステムは、予想以上に単純であることが多いです。当初は分散コンピューティングや組織設計からシステムをモデル化しようと試みました。しかし、それらのすべてがエージェントに適しているわけではありません。
適切な構造の量は、ちょうど中間地点にあります。構造が少なすぎると、エージェント間で競合が発生し、作業が重複し、ドリフトが生じます。一方、構造が多すぎると脆弱性が生まれます。
システムの動作の驚くほど多くの部分が、どのようにエージェントにプロンプト(指示)を与えるかにかかっています。彼らに良好な協調を行わせ、病理的な行動を回避し、長期間にわたって集中力を維持させるためには、広範な実験が必要でした。ハーン(枠組み)やモデルも重要ですが、プロンプトの方がより重要です。
マルチエージェントの協調は依然として困難な問題です。現在のシステムは機能していますが、最適化からはほど遠い状況です。プランナーはタスクが完了した際に目覚め、次のステップを計画すべきです。また、エージェントが長時間実行され続けるケースも稀ではありません。ドリフトや視野狭窄に対抗するためには、依然として定期的な初期化が必要です。
しかし、「より多くのエージェントを問題に投入することで自律型コーディングをスケーリングできるか」という核心的な問いに対する答えは、私たちが予想していたよりも楽観的なものです。数百人のエージェントが単一のコードベース上で数週間協力し、大胆なプロジェクトにおいて実質的な進展を遂げることが可能です。
ここで開発している技術は、最終的に Cursor のエージェント機能に反映されることになります。AI 支援ソフトウェア開発における最も困難な課題に取り組みたいとお考えの方は、hiring@cursor.com までご連絡ください。

原文を表示
We've been experimenting with running coding agents autonomously for weeks.
Our goal is to understand how far we can push the frontier of agentic coding for projects that typically take human teams months to complete.
This post describes what we've learned from running hundreds of concurrent agents on a single project, coordinating their work, and watching them write over a million lines of code and trillions of tokens.
#The limits of a single agent
Today's agents work well for focused tasks, but are slow for complex projects. The natural next step is to run multiple agents in parallel, but figuring out how to coordinate them is challenging.
Our first instinct was that planning ahead would be too rigid. The path through a large project is ambiguous, and the right division of work isn't obvious at the start. We began with dynamic coordination, where agents decide what to do based on what others are currently doing.
#Learning to coordinate
Our initial approach gave agents equal status and let them self-coordinate through a shared file. Each agent would check what others were doing, claim a task, and update its status. To prevent two agents from grabbing the same task, we used a locking mechanism.
This failed in interesting ways:
Agents would hold locks for too long, or forget to release them entirely. Even when locking worked correctly, it became a bottleneck. Twenty agents would slow down to the effective throughput of two or three, with most time spent waiting.
The system was brittle: agents could fail while holding locks, try to acquire locks they already held, or update the coordination file without acquiring the lock at all.
We tried replacing locks with optimistic concurrency control. Agents could read state freely, but writes would fail if the state had changed since they last read it. This was simpler and more robust, but there were still deeper problems.
With no hierarchy, agents became risk-averse. They avoided difficult tasks and made small, safe changes instead. No agent took responsibility for hard problems or end-to-end implementation. This led to work churning for long periods of time without progress.
#Planners and workers
Our next approach was to separate roles. Instead of a flat structure where every agent does everything, we created a pipeline with distinct responsibilities.
Planners continuously explore the codebase and create tasks. They can spawn sub-planners for specific areas, making planning itself parallel and recursive.
Workers pick up tasks and focus entirely on completing them. They don't coordinate with other workers or worry about the big picture. They just grind on their assigned task until it's done, then push their changes.
At the end of each cycle, a judge agent determined whether to continue, then the next iteration would start fresh. This solved most of our coordination problems and let us scale to very large projects without any single agent getting tunnel vision.
#Running for weeks
To test this system, we pointed it at an ambitious goal: building a web browser from scratch. The agents ran for close to a week, writing over 1 million lines of code across 1,000 files. You can explore the source code on GitHub.
Despite the codebase size, new agents can still understand it and make meaningful progress. Hundreds of workers run concurrently, pushing to the same branch with minimal conflicts.
While it might seem like a simple screenshot, building a browser from scratch is extremely difficult.
Another experiment was doing an in-place migration of Solid to React in the Cursor codebase. It took over three weeks with +266K/-193K edits. It still needs careful review, but was passing our CI and early checks.
Another experiment was to improve an upcoming product. A long-running agent made video rendering 25x faster with an efficient Rust version. It also added support to zoom and pan smoothly with natural spring transitions and motion blurs, following the cursor. This code was merged and will be in production soon.
We have a few other interesting examples still running:
Java LSP: 7.4K commits, 550K LoC
Windows 7 emulator: 14.6K commits, 1.2M LoC
Excel: 12K commits, 1.6M LoC
#What we've learned
We've deployed trillions of tokens across these agents toward a single goal. The system isn't perfectly efficient, but it's far more effective than we expected.
Model choice matters for extremely long-running tasks. We found that GPT-5.2 models are much better at extended autonomous work: following instructions, keeping focus, avoiding drift, and implementing things precisely and completely.
Opus 4.5 tends to stop earlier and take shortcuts when convenient, yielding back control quickly. We also found that different models excel at different roles. GPT-5.2 is a better planner than GPT-5.1-Codex, even though the latter is trained specifically for coding. We now use the model best suited for each role rather than one universal model.
Many of our improvements came from removing complexity rather than adding it. We initially built an integrator role for quality control and conflict resolution, but found it created more bottlenecks than it solved. Workers were already capable of handling conflicts themselves.
The best system is often simpler than you'd expect. We initially tried to model systems from distributed computing and organizational design. However, not all of them work for agents.
The right amount of structure is somewhere in the middle. Too little structure and agents conflict, duplicate work, and drift. Too much structure creates fragility.
A surprising amount of the system's behavior comes down to how we prompt the agents. Getting them to coordinate well, avoid pathological behaviors, and maintain focus over long periods required extensive experimentation. The harness and models matter, but the prompts matter more.
Multi-agent coordination remains a hard problem. Our current system works, but we're nowhere near optimal. Planners should wake up when their tasks complete to plan the next step. Agents occasionally run for far too long. We still need periodic fresh starts to combat drift and tunnel vision.
But the core question, can we scale autonomous coding by throwing more agents at a problem, has a more optimistic answer than we expected. Hundreds of agents can work together on a single codebase for weeks, making real progress on ambitious projects.
The techniques we're developing here will eventually inform Cursor's agent capabilities. If you're interested in working on the hardest problems in AI-assisted software development, we'd love to hear from you at hiring@cursor.com.

関連記事
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み