Home›VS Code / Dev Env›VS Code Agent Mergeをいきなり自動化しない。PR修復ループに停止条件を置く
VS Code Agent Mergeをいきなり自動化しない。PR修復ループに停止条件を置く

VS Code Agent Mergeをいきなり自動化しない。PR修復ループに停止条件を置くDo Not Automate VS Code Agent Merge Immediately: Add Stop Conditions to PR Repair Loops

元記事を読むRead original articleqiita.com(新しいタブで開きます)(opens in a new tab)
AI2 点サマリ2 key points
  • VS Code 1.136のPreview機能「Agent Merge」は、レビュー指摘、失敗したチェック、競合の修復とworkflow再実行を支援する。
  • 使い捨てPRで検証し、回数と変更範囲に停止条件を設ける運用は、意図しない改変の拡大を防ぐteamに役立つ。
  • VS Code 1.136 adds preview Agent Merge to fix review issues, failed checks, and conflicts.
  • Testing disposable PRs with cycle and scope limits helps teams contain unintended changes.

本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (qiita.com) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (qiita.com).

要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.

Agent Merge

VS Code 1.136には、Preview機能としてAgent Mergeが追加されました。PRをmerge-readyへ近づける修復ループと、teamがmergeを許可する判断を分け、停止条件を設けて試すことが重要です。

Agent Mergeは、review feedback、failed checks、merge conflictsへの修復とworkflowの再実行を繰り返します。2026年9月2日に公開された機能ですが、最初から実repositoryで継続的に動かすのではなく、影響を限定できる環境で挙動を確かめる進め方が示されています。

修復ループ

agentがreview commentを直しても、required checkが失敗したままになる場合があります。さらに次の修正で、最初の依頼に含まれていないfileまで変更されることも想定されます。

問題は一度の誤修正だけではありません。修復を繰り返すうちに、「何を直すPRだったか」が薄れ、変更範囲が広がる点です。そのため、修復cycleの回数とscopeの両方に停止条件を置きます。merge-readyを目指す処理が続けられる状態でも、teamによるmergeの許可とは切り分けます。

検証の進め方

まず、使い捨てPRでblockerを一種類ずつ作り、各cycleの前後を記録します。次に、検証用repository、またはproduction変更を含まないbranchで小さなPRを作成します。設定は「"chat.agentMerge.enabled" : true」です。

Agents windowで対象sessionを開き、「Enable Agent Merge for Active Session」またはtitle barの「Agent Merge」から有効化します。Previewのため、対応harness、GitHub権限、branch protection、画面上の名称は手元の環境で確認します。

人間がmerge

初回検証の目的は自動mergeではありません。agentがどの入力を受け、何を変更し、どの状態で止まるのかを観察することです。修復の範囲と停止点を確認したうえで、最後のmergeは人間が行います。

Agent Merge

VS Code 1.136, released on September 2, 2026, introduces Agent Merge as a Preview feature. It can repeatedly address review feedback, failed checks, and merge conflicts, then rerun the workflow to move a PR closer to a merge-ready state.

That repair process should not immediately be treated as an automated merge decision. Making a PR merge-ready and deciding whether a team should permit the merge are separate steps.

PR Repair Loops

A repair loop can continue after an agent fixes a review comment while a required check remains failed. A later repair may also modify files that were not included in the original request.

The concern is not limited to a single incorrect change. As repairs accumulate, the original purpose of the PR can become less clear. The recommended first goal is therefore to observe what input the agent receives, what it changes, and under which conditions it stops.

Disposable PRs

The suggested evaluation starts with a disposable PR and introduces one type of blocker at a time. The state before and after every cycle should be recorded.

A small PR should be created in a test repository or on a branch that contains no production changes. Agent Merge can be enabled with this setting:

"chat.agentMerge.enabled" : true

In the Agents window, open the relevant session and select Enable Agent Merge for Active Session, or use Agent Merge in the title bar. Because the feature is currently in Preview, the compatible harness, GitHub permissions, branch protection, and names displayed in the interface should be checked in the local environment.

Stop Conditions

The repair process should have explicit limits on both the number of cycles and the scope of permitted changes. Testing with those limits can help contain unintended modifications before the feature is used continuously in a real repository.

The initial trial is not intended to automate the final merge. After observing the inputs, changes, and stopping behavior, a human performs the merge.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPokoAgent Mergeって、レビュー指摘や失敗したチェックを直し続けるの?頼んでないファイルまで変わるのが気になる!Does Agent Merge keep fixing review comments and failed checks? I’m worried it could start changing files I never asked it to touch!
  2. TECHガイドTECH Guideこの記事では、競合の修復やworkflow再実行も繰り返し、PRをmerge-readyへ近づけるPreview機能じゃ。自動mergeとは別じゃよ。The article describes a preview feature that also repairs conflicts and reruns workflows to move a PR toward merge-ready. That is separate from merging automatically.
  3. ポコPokoつまり、修理ロボットに「決めた回数まで、この範囲だけ」と柵を置く感じ?チームに役立つの?So it’s like telling a repair robot, “Stop after the set number of tries, and stay inside this area”? Is that useful for teams?
  4. TECHガイドTECH Guide書かれている運用では、使い捨てPRで一種類ずつ試し、回数と変更範囲に停止条件を置くんじゃ。意図しない改変の拡大を抑えたいチーム向けじゃのう。The suggested approach is to test one blocker at a time in disposable PRs, with limits on cycles and scope. That helps teams contain unintended changes.
  5. ポコPokoへえ、まず小さく試して、エージェントが何を変え、どこで止まるか確かめる使い方なんだね!Oh, so the idea is to start small and check what the agent changes and where it stops!
  6. TECHガイドTECH Guide本文が念を押すのは、現時点ではPreviewで、対応harnessやGitHub権限、branch protection、画面名を環境ごとに確認し、最後は人がmergeする点じゃ。The piece also cautions that it is still in preview. Verify the supported harness, GitHub permissions, branch protection, and UI labels in your environment—and leave the final merge to a human.
記事情報・収集記録Article details & collection record
出典Source
Qiita VSCodeコミュニティCommunity
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
JA
重要度の位置づけImportance in this lane
MediumMedium priority(VS Code / Dev Env 58件中、同等以上 39件)(39 of 58 VS Code / Dev Env entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
1.7 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
中期 (チュートリアル)Medium-term (tutorial)

🔷VS Code / Dev Env の他の記事More from VS Code / Dev Envもっと見る →View more →

ページ上部へScroll to top