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
-3
View File
@@ -1,8 +1,5 @@
# Bugs
- Merge explains why it did nothing
`confirmMerge` in `web/src/task.ts` returns silently when the agent is running, a merge is queued, or no commits or files differ from the default branch. Each case shows an alert instead: "Agent is mid-turn; merge when it's idle", "Merge already held behind another merge in this project", "Nothing to merge: no commits or uncommitted files differ from main".
# M1 — One agent end to end
# M2 — Seeing the work
+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;
+1 -1
View File
File diff suppressed because one or more lines are too long
+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;