デバッグモードの導入:ランタイムログ付きエージェント
本文の状態
日本語全文を表示中
詳細モードで約3分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Cursor Blog
開発者がランタイムログを活用して複雑なバグを再現・修正できるデバッグモードを提供する。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
コーディングエージェントは多くの作業に優れていますが、特定のバグには一貫して対処できないことがあります。そこで、ランタイム情報と人間による検証を中心に構築された全く新しいエージェントループ「Debug Mode」を導入します。
この機能を開発するため、私たちはチーム内の優秀なデバッガーの実践手法を分析しました。彼らのワークフローをエージェントモードに統合し、コードにランタイムログを計測するツール、問題の原因に関する複数の仮説を生成するプロンプト、そして問題の再現と修正の検証のためにユーザーにコールバックする機能を装備しました。
その結果、以前は最も優秀なモデルが単独で取り組んでも解決できなかった、あるいは開発者の多大な時間を要していたバグを、確実に修正できるインタラクティブなプロセスが実現しました。
#バグの説明
開始するには、ドロップダウンメニューからDebug Modeを選択し、バグについて可能な限り詳細に説明してください。
エージェントはすぐに修正を生成しようとするのではなく、まずコードベースを読み込み、何が問題となっているかについて複数の仮説を生成します。その中には、あなた自身が思い付くようなアイデアもあれば、これまで考慮していなかったアプローチも含まれるでしょう。
次にエージェントは、これらの仮説を検証するために設計されたロギングステートメントをコードに追加し、計測を行います。これにより、バグ発生時に実際に何が起こっているかについて、具体的なデータを受け取る準備が整います。
#バグの再現
次に、ご自身のアプリケーションに移動し、エージェントがランタイムログを収集している間にバグを再現してください。
エージェントは、バグ発生時にコード内で何が起きているかを正確に把握できます。変数の状態、実行パス、タイミング情報などです。このデータを用いて根本原因を特定し、的を絞った修正を生成します。多くの場合、標準的なエージェントとのやり取りで受け取るような数百行に及ぶ推測的なコードではなく、正確な2〜3行の修正となります。
#修正の検証
この段階で、Debug Modeは提案された修正を適用した状態で、バグをもう一度再現するよう依頼します。バグが解消されていれば、修正済みとしてマークしてください。エージェントはすべての計測コードを削除し、クリーンで最小限の変更のみを残します。これでその変更をすぐに適用できます。
この人間が関与する検証ループは極めて重要です。バグが明らかな場合もありますが、技術的には機能するものの、何かしっくりこない「グレーゾーン」に該当するケースもあります。エージェントだけではこの判断はできません。もしバグが修正されていないと判断した場合は、エージェントがさらにロギングを追加し、あなたが再現を行い、問題が実際に解決されるまでアプローチを改善していきます。
このような密接な対話こそ、AIコーディングが最も効果を発揮する方法の一つであると考えています。エージェントが煩雑な作業を担い、人間が判断を要する迅速な意思決定を行うのです。Debug Modeにより、これまで手に負えなかった厄介なバグも、確実に修正できるようになりました。
Debug Modeのドキュメントをお読みください。Cursor 2.2のすべての新機能についてご確認いただけます。
原文を表示
Coding agents are great at lots of things, but some bugs consistently stump them. That's why we're introducing Debug Mode, an entirely new agent loop built around runtime information and human verification.
To build it, we examined the practices of the best debuggers on our team. We rolled their workflows into an agent mode, equipping it with tools to instrument code with runtime logs, prompts that generate multiple hypotheses about what's going wrong, and the ability to call back to you to reproduce the issue and verify fixes.
The result is an interactive process that reliably fixes bugs that were previously beyond the reach of even the smartest models working alone, or could take significant developer time to address.
#Describe the bug
To get started, select Debug Mode from the dropdown menu and describe the bug in as much detail as you can.
Instead of immediately trying to generate a fix, the agent reads through your codebase and generates multiple hypotheses about what could be wrong. Some will be ideas you would have thought of on your own, but others will likely be approaches you wouldn't have considered.
The agent then instruments your code with logging statements designed to test these hypotheses. This prepares the agent to receive concrete data about what's actually happening when the bug occurs.
#Reproduce the bug
Next, go to your application and reproduce the bug while the agent collects the runtime logs.
The agent can see exactly what's happening in your code when the bug occurs: variable states, execution paths, timing information. With this data, it can pinpoint the root cause and generate a targeted fix. Often that's a precise two or three line modification instead of the hundreds of lines of speculative code you'd have received with a standard agent interaction.
#Verify the fix
At this point, Debug Mode asks you to reproduce the bug one more time with the proposed fix in place. If the bug is gone, you mark it as fixed and the agent removes all the instrumentation, leaving you with a clean, minimal change you can ship.
This human-in-the-loop verification is critical. Sometimes bugs are obvious, but other times they fall into a gray area where the fix might work technically but not feel right. The agent can't make that call on its own. If you don't think the bug is fixed, the agent adds more logging, you reproduce again, and it refines its approach until the problem is actually solved.
This kind of tight back-and-forth is one way we think AI coding works best. The agent handles the tedious work while you make the quick decisions that need human judgment. The result with Debug Mode is that tricky bugs that used to be out of reach are now reliably fixed.
Read the Debug Mode docs. Learn about all the new features in Cursor 2.2.
関連記事
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み