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.
This commit is contained in:
Lukas May
2026-03-06 22:43:56 +01:00
parent e7c95af1ca
commit bc61e658dc
2 changed files with 6 additions and 3 deletions

View File

@@ -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],
);

View File

@@ -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;