Merge explains why it did nothing
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
# Bugs
|
# 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
|
# M1 — One agent end to end
|
||||||
|
|
||||||
# M2 — Seeing the work
|
# M2 — Seeing the work
|
||||||
|
|||||||
Vendored
+10
-1
@@ -933,7 +933,15 @@ function messageImages(ids) {
|
|||||||
export async function confirmMerge(taskId) {
|
export async function confirmMerge(taskId) {
|
||||||
const task = findTask(taskId);
|
const task = findTask(taskId);
|
||||||
const sessionState = currentSession(taskId)?.state;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
const target = state.projects.find((p) => p.id === task.project_id)?.default_branch ?? "the default branch";
|
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 } }),
|
get("/api/tasks/{taskId}/co-authors", { path: { taskId } }),
|
||||||
]);
|
]);
|
||||||
if (unmerged.commits === 0 && unmerged.files === 0) {
|
if (unmerged.commits === 0 && unmerged.files === 0) {
|
||||||
|
void showAlert(`Nothing to merge: no commits or uncommitted files differ from ${target}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
coAuthors = people;
|
coAuthors = people;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+10
-1
@@ -1113,7 +1113,15 @@ function messageImages(ids: unknown): HTMLElement | null {
|
|||||||
export async function confirmMerge(taskId: string): Promise<void> {
|
export async function confirmMerge(taskId: string): Promise<void> {
|
||||||
const task = findTask(taskId);
|
const task = findTask(taskId);
|
||||||
const sessionState = currentSession(taskId)?.state;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
const target = state.projects.find((p) => p.id === task.project_id)?.default_branch ?? "the default branch";
|
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 } }),
|
get("/api/tasks/{taskId}/co-authors", { path: { taskId } }),
|
||||||
]);
|
]);
|
||||||
if (unmerged.commits === 0 && unmerged.files === 0) {
|
if (unmerged.commits === 0 && unmerged.files === 0) {
|
||||||
|
void showAlert(`Nothing to merge: no commits or uncommitted files differ from ${target}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
coAuthors = people;
|
coAuthors = people;
|
||||||
|
|||||||
Reference in New Issue
Block a user