fix(worker): preview_merge braucht einen runVerify-Parameter wie preview_merge_set
preview_merge baute bisher immer, sobald die Liste ein Verify-Kommando konfiguriert hatte -- anders als das Geschwister-Tool preview_merge_set, dessen runVerify-Parameter per Default false ist. Ein einzelnes preview_merge im Merge-Helper-Recheck stiess dadurch einen ungewollten Scratch-Build an. runVerify (Default false) jetzt symmetrisch bei preview_merge ergaenzt, Description-Text und die Merge-Helper-Prompt-Doku angepasst. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
committed by
mika kuns
co-authored by
Claude Sonnet 5
parent
c874bf7e52
commit
7452f6cfe4
@@ -523,7 +523,7 @@ public static class PromptFiles
|
||||
- Clean merge → mergeStatus "merged_verify_pending" (expected: the task deliberately stays WaitingForReview until verify_merges passes) or "merged" (list has no verify command; the task is Done). Either way, move on.
|
||||
- Conflict (markers left in the working tree, repoPath returned) → resolve it below.
|
||||
|
||||
After each merge, main has moved — a clean preview_merge_set result from before this merge is now stale for the remaining tasks. If you are unsure whether an earlier overlap warning still matters, call preview_merge for the next task again before merging it.
|
||||
After each merge, main has moved — a clean preview_merge_set result from before this merge is now stale for the remaining tasks. If you are unsure whether an earlier overlap warning still matters, call preview_merge for the next task again before merging it (default runVerify=false — this is just a conflict recheck, not a build; the verify command still runs once via verify_merges after the last merge).
|
||||
|
||||
Every branch in this run forked from the same base, so conflicts between them are the NORMAL case, not a failure. Resolve them and keep going; do not abandon the run because a merge conflicted.
|
||||
|
||||
|
||||
+16
-12
@@ -446,26 +446,30 @@ public sealed class MergeMcpTools
|
||||
"untracked, in the target working directory — merge-tree can't see the working tree at all, so this is the " +
|
||||
"only way to catch it before a real merge either refuses or, if that path became tracked in the meantime, " +
|
||||
"silently overwrites it); behind counts commits on targetBranch not yet on this branch, which flags a stale " +
|
||||
"branch even when the preview is clean. If the list has a verify command configured, a clean preview is " +
|
||||
"additionally built/tested in a scratch worktree (still without touching the real working tree) — " +
|
||||
"verifyExitCode 0 means it built clean, non-zero or -1 (timeout/failed to start) means it doesn't, with the " +
|
||||
"tail of its output in verifyOutputTail; verifyExitCode stays null when no verify command is configured. " +
|
||||
"isEmpty=true means the task's review range contributed nothing; check that flag rather than reading a " +
|
||||
"small changedFileCount as empty. staleFiles lists files this branch touches that the target branch ALSO " +
|
||||
"changed since this branch's fork point — a more honest staleness signal than `behind` alone, since a " +
|
||||
"branch can be far behind yet touch nothing the target changed, or barely behind yet collide on the one " +
|
||||
"file that matters (always empty for a worktree-less handler task, which has no fork point). Throws if the " +
|
||||
"task has neither an active worktree nor a handler commit range, or the list's working directory is missing " +
|
||||
"from disk." + McpToolDocs.ProgressHint)]
|
||||
"branch even when the preview is clean. runVerify=false (default) never builds. runVerify=true additionally " +
|
||||
"builds/tests a clean preview in a scratch worktree (still without touching the real working tree), if the " +
|
||||
"list has a verify command configured — verifyExitCode 0 means it built clean, non-zero or -1 " +
|
||||
"(timeout/failed to start) means it doesn't, with the tail of its output in verifyOutputTail; " +
|
||||
"verifyExitCode/verifyDurationMs/verifyOutputTail stay null without runVerify=true or without a configured " +
|
||||
"verify command. isEmpty=true means the task's review range contributed nothing; check that flag rather " +
|
||||
"than reading a small changedFileCount as empty. staleFiles lists files this branch touches that the " +
|
||||
"target branch ALSO changed since this branch's fork point — a more honest staleness signal than `behind` " +
|
||||
"alone, since a branch can be far behind yet touch nothing the target changed, or barely behind yet " +
|
||||
"collide on the one file that matters (always empty for a worktree-less handler task, which has no fork " +
|
||||
"point). Throws if the task has neither an active worktree nor a handler commit range, or the list's " +
|
||||
"working directory is missing from disk." + McpToolDocs.ProgressHint)]
|
||||
public async Task<MergePreviewToolDto> PreviewMerge(
|
||||
string taskId,
|
||||
[Description("Branch to preview against; defaults to the repo's current branch.")]
|
||||
string? targetBranch = null,
|
||||
[Description("true: also run the verify command (if configured), building in a scratch worktree. " +
|
||||
"false (default): no build.")]
|
||||
bool runVerify = false,
|
||||
CancellationToken cancellationToken = default,
|
||||
IProgress<ProgressNotificationValue>? progress = null)
|
||||
{
|
||||
taskId = await TaskIdResolver.ResolveAsync(_tasks, taskId, cancellationToken);
|
||||
var (preview, behind, _, isEmpty, staleFiles, _, _) = await PreviewMergeCoreAsync(taskId, targetBranch, runVerify: true, cancellationToken, progress);
|
||||
var (preview, behind, _, isEmpty, staleFiles, _, _) = await PreviewMergeCoreAsync(taskId, targetBranch, runVerify, cancellationToken, progress);
|
||||
return new MergePreviewToolDto(preview.Status, preview.ConflictFiles, preview.ChangedFileCount, behind, isEmpty,
|
||||
preview.VerifyExitCode, preview.VerifyDurationMs, preview.VerifyOutputTail, staleFiles);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user