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
@@ -1113,7 +1113,15 @@ function messageImages(ids: unknown): HTMLElement | null {
export async function confirmMerge(taskId: string): Promise<void> {
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";
@@ -1124,6 +1132,7 @@ export async function confirmMerge(taskId: string): Promise<void> {
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;