Fix stranded task retry and respec reset

This commit is contained in:
gsxdsm
2026-04-13 11:10:17 -07:00
parent 2486f2fb07
commit 0a1def0cc7
6 changed files with 206 additions and 35 deletions

View File

@@ -253,6 +253,14 @@ export function TaskDetailModal({
// Derive a working task that always has all available fields.
// Falls back to the optimistic Task while loading, uses fullDetail once loaded.
const workingTask: TaskDetail = fullDetail ?? { ...task, prompt: "" } as TaskDetail;
const canRetryTask =
task.status === "failed" ||
task.status === "stuck-killed" ||
task.status === "specifying" ||
task.status === "needs-respecify" ||
(task.stuckKillCount ?? 0) > 0 ||
(task.recoveryRetryCount ?? 0) > 0 ||
Boolean(task.nextRecoveryAt);
// Sync activeTab when the caller changes initialTab (e.g. opening a different tab)
useEffect(() => {
@@ -1564,7 +1572,7 @@ export function TaskDetailModal({
)}
{/* Actions dropdown — less common operations */}
{(task.column !== "triage" || task.status === "awaiting-approval") && (
{(task.column !== "triage" || task.status === "awaiting-approval" || canRetryTask) && (
<div className="detail-actions-dropdown" ref={actionsMenuRef}>
<button
className="btn btn-sm"
@@ -1623,7 +1631,7 @@ export function TaskDetailModal({
)}
{/* Retry */}
{(task.status === "failed" || task.status === "stuck-killed") && onRetryTask && (
{canRetryTask && onRetryTask && (
<button
className="detail-actions-menu-item"
role="menuitem"