Merge explains why it did nothing

This commit is contained in:
Ian Gulliver
2026-10-16 08:29:51 -07:00
parent 9a7de4c4b2
commit 19e6881618
4 changed files with 21 additions and 6 deletions
+10 -1
View File
@@ -933,7 +933,15 @@ function messageImages(ids) {
export async function confirmMerge(taskId) {
const task = findTask(taskId);
const sessionState = currentSession(taskId)?.state;
if (!task || task.status !== "active" || task.merge_queued_at !== undefined || sessionState === "running") {
if (!task || task.status !== "active") {
return;
}
if (sessionState === "running") {
void showAlert("Agent is mid-turn; merge when it's idle");
return;
}
if (task.merge_queued_at !== undefined) {
void showAlert("Merge already held behind another merge in this project");
return;
}
const target = state.projects.find((p) => p.id === task.project_id)?.default_branch ?? "the default branch";
@@ -944,6 +952,7 @@ export async function confirmMerge(taskId) {
get("/api/tasks/{taskId}/co-authors", { path: { taskId } }),
]);
if (unmerged.commits === 0 && unmerged.files === 0) {
void showAlert(`Nothing to merge: no commits or uncommitted files differ from ${target}`);
return;
}
coAuthors = people;