From bc61e658dc7666a2103af85fc5ab4946709ee2c6 Mon Sep 17 00:00:00 2001 From: Lukas May Date: Fri, 6 Mar 2026 22:43:56 +0100 Subject: [PATCH] fix: allow re-detailing phases after all tasks are deleted The "Detail Tasks" button was hidden when an idle detail agent from a previous run was still associated with the phase. The frontend gate blocked any re-detail while a detail agent existed, even if it was idle (i.e. done). The backend already auto-dismisses stale idle agents, so the frontend just needed to allow idle agents through the gate. --- apps/web/src/components/execution/PhaseActions.tsx | 7 +++++-- apps/web/src/components/execution/PhaseDetailPanel.tsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/execution/PhaseActions.tsx b/apps/web/src/components/execution/PhaseActions.tsx index e92ad97..2187bb1 100644 --- a/apps/web/src/components/execution/PhaseActions.tsx +++ b/apps/web/src/components/execution/PhaseActions.tsx @@ -19,9 +19,12 @@ export function PhaseActions({ const detailMutation = trpc.spawnArchitectDetail.useMutation(); const [isDetailingAll, setIsDetailingAll] = useState(false); - // Phases eligible for detailing: no tasks AND no active detail agent + // Phases eligible for detailing: no tasks AND no actively running detail agent const eligiblePhaseIds = useMemo( - () => phasesWithoutTasks.filter((id) => !detailAgentByPhase.has(id)), + () => phasesWithoutTasks.filter((id) => { + const agent = detailAgentByPhase.get(id); + return !agent || agent.status === "idle"; + }), [phasesWithoutTasks, detailAgentByPhase], ); diff --git a/apps/web/src/components/execution/PhaseDetailPanel.tsx b/apps/web/src/components/execution/PhaseDetailPanel.tsx index 2a7cbfb..9e72f0c 100644 --- a/apps/web/src/components/execution/PhaseDetailPanel.tsx +++ b/apps/web/src/components/execution/PhaseDetailPanel.tsx @@ -207,7 +207,7 @@ export function PhaseDetailPanel({ detailAgent?.status === "running" || detailAgent?.status === "waiting_for_input"; const showDetailButton = - !detailAgent && !hasTasks; + !hasTasks && (!detailAgent || detailAgent.status === "idle"); const showChangeSet = detailAgent?.status === "idle" && !!latestChangeSet;