2025-06-24 10:27:30 +01:00
|
|
|
import { useState, useEffect, useMemo, useRef, useCallback } from "react";
|
2025-06-22 21:31:18 +01:00
|
|
|
import { Link } from "react-router-dom";
|
2025-06-21 17:36:07 +01:00
|
|
|
import {
|
|
|
|
|
X,
|
|
|
|
|
History,
|
|
|
|
|
Clock,
|
|
|
|
|
Code,
|
2025-06-21 19:13:42 +01:00
|
|
|
ChevronDown,
|
|
|
|
|
ChevronUp,
|
2025-06-21 20:04:15 +01:00
|
|
|
Settings2,
|
2025-06-21 22:41:35 +01:00
|
|
|
Edit,
|
|
|
|
|
Trash2,
|
2025-06-21 23:40:13 +01:00
|
|
|
StopCircle,
|
2025-06-24 01:05:55 +01:00
|
|
|
Send,
|
2025-06-24 01:16:39 +01:00
|
|
|
AlertCircle,
|
2025-06-24 16:50:58 +01:00
|
|
|
Play,
|
2025-06-24 17:09:15 +01:00
|
|
|
GitCompare,
|
2025-06-21 17:36:07 +01:00
|
|
|
} from "lucide-react";
|
2025-06-21 16:49:16 +01:00
|
|
|
import { Button } from "@/components/ui/button";
|
2025-06-24 01:16:39 +01:00
|
|
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
2025-06-21 16:49:16 +01:00
|
|
|
import { Label } from "@/components/ui/label";
|
2025-06-21 20:44:36 +01:00
|
|
|
import { Chip } from "@/components/ui/chip";
|
2025-06-24 17:34:31 +01:00
|
|
|
import { FileSearchTextarea } from "@/components/ui/file-search-textarea";
|
2025-06-24 16:50:58 +01:00
|
|
|
import {
|
|
|
|
|
Tooltip,
|
|
|
|
|
TooltipContent,
|
|
|
|
|
TooltipProvider,
|
|
|
|
|
TooltipTrigger,
|
|
|
|
|
} from "@/components/ui/tooltip";
|
2025-06-21 22:12:32 +01:00
|
|
|
import { ExecutionOutputViewer } from "./ExecutionOutputViewer";
|
2025-06-22 22:41:16 +01:00
|
|
|
import { EditorSelectionDialog } from "./EditorSelectionDialog";
|
2025-06-21 19:13:42 +01:00
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
DropdownMenu,
|
|
|
|
|
DropdownMenuContent,
|
|
|
|
|
DropdownMenuItem,
|
|
|
|
|
DropdownMenuTrigger,
|
|
|
|
|
} from "@/components/ui/dropdown-menu";
|
|
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
import { makeRequest } from "@/lib/api";
|
2025-06-21 19:13:42 +01:00
|
|
|
import {
|
|
|
|
|
getTaskPanelClasses,
|
|
|
|
|
getBackdropClasses,
|
|
|
|
|
} from "@/lib/responsive-config";
|
2025-06-21 22:19:25 +01:00
|
|
|
import { useConfig } from "@/components/config-provider";
|
2025-06-21 16:49:16 +01:00
|
|
|
import type {
|
|
|
|
|
TaskStatus,
|
|
|
|
|
TaskAttempt,
|
|
|
|
|
TaskAttemptActivity,
|
|
|
|
|
TaskAttemptStatus,
|
|
|
|
|
ApiResponse,
|
|
|
|
|
TaskWithAttemptStatus,
|
2025-06-21 20:44:36 +01:00
|
|
|
ExecutionProcess,
|
2025-06-24 16:50:58 +01:00
|
|
|
ExecutionProcessSummary,
|
2025-06-22 22:41:16 +01:00
|
|
|
EditorType,
|
2025-06-24 16:50:58 +01:00
|
|
|
Project,
|
2025-06-21 16:49:16 +01:00
|
|
|
} from "shared/types";
|
|
|
|
|
|
|
|
|
|
interface TaskDetailsPanelProps {
|
|
|
|
|
task: TaskWithAttemptStatus | null;
|
2025-06-24 16:50:58 +01:00
|
|
|
project: Project | null;
|
2025-06-21 16:49:16 +01:00
|
|
|
projectId: string;
|
|
|
|
|
isOpen: boolean;
|
|
|
|
|
onClose: () => void;
|
2025-06-21 22:41:35 +01:00
|
|
|
onEditTask?: (task: TaskWithAttemptStatus) => void;
|
|
|
|
|
onDeleteTask?: (taskId: string) => void;
|
2025-06-24 17:25:15 +01:00
|
|
|
isDialogOpen?: boolean; // New prop to indicate if any dialog is open
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const statusLabels: Record<TaskStatus, string> = {
|
|
|
|
|
todo: "To Do",
|
2025-06-21 17:36:07 +01:00
|
|
|
inprogress: "In Progress",
|
2025-06-21 16:49:16 +01:00
|
|
|
inreview: "In Review",
|
|
|
|
|
done: "Done",
|
|
|
|
|
cancelled: "Cancelled",
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 20:44:36 +01:00
|
|
|
const getTaskStatusDotColor = (status: TaskStatus): string => {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case "todo":
|
|
|
|
|
return "bg-gray-400";
|
|
|
|
|
case "inprogress":
|
|
|
|
|
return "bg-blue-500";
|
|
|
|
|
case "inreview":
|
|
|
|
|
return "bg-yellow-500";
|
|
|
|
|
case "done":
|
|
|
|
|
return "bg-green-500";
|
|
|
|
|
case "cancelled":
|
|
|
|
|
return "bg-red-500";
|
|
|
|
|
default:
|
|
|
|
|
return "bg-gray-400";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 17:36:07 +01:00
|
|
|
const getAttemptStatusDisplay = (
|
|
|
|
|
status: TaskAttemptStatus
|
2025-06-21 20:44:36 +01:00
|
|
|
): { label: string; dotColor: string } => {
|
2025-06-21 16:49:16 +01:00
|
|
|
switch (status) {
|
|
|
|
|
case "setuprunning":
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Setup Running",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-blue-500",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
case "setupcomplete":
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Setup Complete",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-green-500",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
case "setupfailed":
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Setup Failed",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-red-500",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
case "executorrunning":
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Executor Running",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-blue-500",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
case "executorcomplete":
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Executor Complete",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-green-500",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
case "executorfailed":
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Executor Failed",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-red-500",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
default:
|
2025-06-21 17:36:07 +01:00
|
|
|
return {
|
|
|
|
|
label: "Unknown",
|
2025-06-21 20:44:36 +01:00
|
|
|
dotColor: "bg-gray-400",
|
2025-06-21 17:36:07 +01:00
|
|
|
};
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 17:36:07 +01:00
|
|
|
export function TaskDetailsPanel({
|
|
|
|
|
task,
|
2025-06-24 16:50:58 +01:00
|
|
|
project,
|
2025-06-21 17:36:07 +01:00
|
|
|
projectId,
|
|
|
|
|
isOpen,
|
|
|
|
|
onClose,
|
2025-06-21 22:41:35 +01:00
|
|
|
onEditTask,
|
|
|
|
|
onDeleteTask,
|
2025-06-24 17:25:15 +01:00
|
|
|
isDialogOpen = false,
|
2025-06-21 17:36:07 +01:00
|
|
|
}: TaskDetailsPanelProps) {
|
2025-06-21 16:49:16 +01:00
|
|
|
const [taskAttempts, setTaskAttempts] = useState<TaskAttempt[]>([]);
|
2025-06-21 17:36:07 +01:00
|
|
|
const [selectedAttempt, setSelectedAttempt] = useState<TaskAttempt | null>(
|
|
|
|
|
null
|
|
|
|
|
);
|
2025-06-24 16:50:58 +01:00
|
|
|
// Combined attempt data state
|
|
|
|
|
const [attemptData, setAttemptData] = useState<{
|
|
|
|
|
activities: TaskAttemptActivity[];
|
|
|
|
|
processes: ExecutionProcessSummary[];
|
|
|
|
|
runningProcessDetails: Record<string, ExecutionProcess>;
|
|
|
|
|
}>({
|
|
|
|
|
activities: [],
|
|
|
|
|
processes: [],
|
|
|
|
|
runningProcessDetails: {},
|
|
|
|
|
});
|
2025-06-21 16:49:16 +01:00
|
|
|
const [loading, setLoading] = useState(false);
|
2025-06-21 19:13:42 +01:00
|
|
|
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
|
2025-06-21 22:19:25 +01:00
|
|
|
const [selectedExecutor, setSelectedExecutor] = useState<string>("claude");
|
2025-06-21 23:40:13 +01:00
|
|
|
const [isStopping, setIsStopping] = useState(false);
|
2025-06-22 21:41:02 +01:00
|
|
|
const [expandedOutputs, setExpandedOutputs] = useState<Set<string>>(
|
|
|
|
|
new Set()
|
|
|
|
|
);
|
2025-06-22 22:41:16 +01:00
|
|
|
const [showEditorDialog, setShowEditorDialog] = useState(false);
|
2025-06-24 01:05:55 +01:00
|
|
|
const [followUpMessage, setFollowUpMessage] = useState("");
|
|
|
|
|
const [isSendingFollowUp, setIsSendingFollowUp] = useState(false);
|
2025-06-24 01:16:39 +01:00
|
|
|
const [followUpError, setFollowUpError] = useState<string | null>(null);
|
2025-06-24 16:50:58 +01:00
|
|
|
const [isStartingDevServer, setIsStartingDevServer] = useState(false);
|
|
|
|
|
const [devServerDetails, setDevServerDetails] =
|
|
|
|
|
useState<ExecutionProcess | null>(null);
|
|
|
|
|
const [isHoveringDevServer, setIsHoveringDevServer] = useState(false);
|
|
|
|
|
|
2025-06-24 10:27:30 +01:00
|
|
|
// Auto-scroll state
|
|
|
|
|
const [shouldAutoScroll, setShouldAutoScroll] = useState(true);
|
|
|
|
|
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
2025-06-21 22:19:25 +01:00
|
|
|
const { config } = useConfig();
|
2025-06-21 20:04:15 +01:00
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
// Find running dev server in current project (across all task attempts)
|
|
|
|
|
const runningDevServer = useMemo(() => {
|
|
|
|
|
return attemptData.processes.find(
|
|
|
|
|
(process) =>
|
|
|
|
|
process.process_type === "devserver" && process.status === "running"
|
|
|
|
|
);
|
|
|
|
|
}, [attemptData.processes]);
|
|
|
|
|
|
2025-06-24 10:49:25 +01:00
|
|
|
// Handle ESC key locally to prevent global navigation
|
|
|
|
|
useEffect(() => {
|
2025-06-24 17:25:15 +01:00
|
|
|
if (!isOpen || isDialogOpen) return; // Don't handle ESC if dialog is open
|
2025-06-24 10:49:25 +01:00
|
|
|
|
|
|
|
|
const handleKeyDown = (event: KeyboardEvent) => {
|
2025-06-24 16:50:58 +01:00
|
|
|
if (event.key === "Escape") {
|
2025-06-24 10:49:25 +01:00
|
|
|
event.preventDefault();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
onClose();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
document.addEventListener("keydown", handleKeyDown, true); // Use capture phase
|
|
|
|
|
return () => document.removeEventListener("keydown", handleKeyDown, true);
|
2025-06-24 17:25:15 +01:00
|
|
|
}, [isOpen, onClose, isDialogOpen]);
|
2025-06-24 10:49:25 +01:00
|
|
|
|
2025-06-21 20:04:15 +01:00
|
|
|
// Available executors
|
|
|
|
|
const availableExecutors = [
|
|
|
|
|
{ id: "echo", name: "Echo" },
|
|
|
|
|
{ id: "claude", name: "Claude" },
|
|
|
|
|
{ id: "amp", name: "Amp" },
|
|
|
|
|
];
|
2025-06-21 16:49:16 +01:00
|
|
|
|
2025-06-21 23:40:13 +01:00
|
|
|
// Check if any execution process is currently running
|
|
|
|
|
const isAttemptRunning = useMemo(() => {
|
2025-06-24 16:50:58 +01:00
|
|
|
if (!selectedAttempt || attemptData.activities.length === 0 || isStopping) {
|
2025-06-21 23:40:13 +01:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Group activities by execution_process_id and get the latest one for each
|
|
|
|
|
const latestActivitiesByProcess = new Map<string, TaskAttemptActivity>();
|
2025-06-22 21:41:02 +01:00
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
attemptData.activities.forEach((activity) => {
|
2025-06-22 21:41:02 +01:00
|
|
|
const existing = latestActivitiesByProcess.get(
|
|
|
|
|
activity.execution_process_id
|
|
|
|
|
);
|
|
|
|
|
if (
|
|
|
|
|
!existing ||
|
|
|
|
|
new Date(activity.created_at) > new Date(existing.created_at)
|
|
|
|
|
) {
|
2025-06-21 23:40:13 +01:00
|
|
|
latestActivitiesByProcess.set(activity.execution_process_id, activity);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Check if any execution process has a running status as its latest activity
|
|
|
|
|
return Array.from(latestActivitiesByProcess.values()).some(
|
|
|
|
|
(activity) =>
|
|
|
|
|
activity.status === "setuprunning" ||
|
|
|
|
|
activity.status === "executorrunning"
|
|
|
|
|
);
|
2025-06-24 16:50:58 +01:00
|
|
|
}, [selectedAttempt, attemptData.activities, isStopping]);
|
2025-06-21 16:49:16 +01:00
|
|
|
|
2025-06-24 01:05:55 +01:00
|
|
|
// Check if follow-up should be enabled
|
|
|
|
|
const canSendFollowUp = useMemo(() => {
|
2025-06-24 16:50:58 +01:00
|
|
|
if (
|
|
|
|
|
!selectedAttempt ||
|
|
|
|
|
attemptData.activities.length === 0 ||
|
|
|
|
|
isAttemptRunning ||
|
|
|
|
|
isSendingFollowUp
|
|
|
|
|
) {
|
2025-06-24 01:05:55 +01:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Need at least one completed coding agent execution
|
2025-06-24 16:50:58 +01:00
|
|
|
const codingAgentActivities = attemptData.activities.filter(
|
2025-06-24 01:05:55 +01:00
|
|
|
(activity) => activity.status === "executorcomplete"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return codingAgentActivities.length > 0;
|
2025-06-24 16:50:58 +01:00
|
|
|
}, [
|
|
|
|
|
selectedAttempt,
|
|
|
|
|
attemptData.activities,
|
|
|
|
|
isAttemptRunning,
|
|
|
|
|
isSendingFollowUp,
|
|
|
|
|
]);
|
2025-06-24 01:05:55 +01:00
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
// Polling for updates when attempt is running
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!isAttemptRunning || !task) return;
|
|
|
|
|
|
|
|
|
|
const interval = setInterval(() => {
|
|
|
|
|
if (selectedAttempt) {
|
2025-06-24 16:50:58 +01:00
|
|
|
fetchAttemptData(selectedAttempt.id, true);
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
|
|
return () => clearInterval(interval);
|
|
|
|
|
}, [isAttemptRunning, task?.id, selectedAttempt?.id]);
|
|
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
// Fetch dev server details when hovering
|
|
|
|
|
const fetchDevServerDetails = async () => {
|
|
|
|
|
if (!runningDevServer || !task || !selectedAttempt) return;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/execution-processes/${runningDevServer.id}`
|
|
|
|
|
);
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
const result: ApiResponse<ExecutionProcess> = await response.json();
|
|
|
|
|
if (result.success && result.data) {
|
|
|
|
|
setDevServerDetails(result.data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error("Failed to fetch dev server details:", err);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Poll dev server details while hovering
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!isHoveringDevServer || !runningDevServer) {
|
|
|
|
|
setDevServerDetails(null);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fetch immediately
|
|
|
|
|
fetchDevServerDetails();
|
|
|
|
|
|
|
|
|
|
// Then poll every 2 seconds
|
|
|
|
|
const interval = setInterval(fetchDevServerDetails, 2000);
|
|
|
|
|
return () => clearInterval(interval);
|
|
|
|
|
}, [
|
|
|
|
|
isHoveringDevServer,
|
|
|
|
|
runningDevServer?.id,
|
|
|
|
|
task?.id,
|
|
|
|
|
selectedAttempt?.id,
|
|
|
|
|
]);
|
|
|
|
|
|
2025-06-24 17:35:21 +01:00
|
|
|
// Memoize processed dev server logs to prevent stuttering
|
|
|
|
|
const processedDevServerLogs = useMemo(() => {
|
|
|
|
|
if (!devServerDetails) return "No output yet...";
|
|
|
|
|
|
|
|
|
|
const stdout = devServerDetails.stdout || "";
|
|
|
|
|
const stderr = devServerDetails.stderr || "";
|
|
|
|
|
const allOutput = stdout + (stderr ? "\n" + stderr : "");
|
|
|
|
|
const lines = allOutput.split("\n").filter((line) => line.trim());
|
|
|
|
|
const lastLines = lines.slice(-10);
|
|
|
|
|
return lastLines.length > 0 ? lastLines.join("\n") : "No output yet...";
|
|
|
|
|
}, [devServerDetails?.stdout, devServerDetails?.stderr]);
|
|
|
|
|
|
2025-06-21 22:19:25 +01:00
|
|
|
// Set default executor from config
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (config) {
|
|
|
|
|
setSelectedExecutor(config.executor.type);
|
|
|
|
|
}
|
|
|
|
|
}, [config]);
|
|
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
useEffect(() => {
|
|
|
|
|
if (task && isOpen) {
|
|
|
|
|
fetchTaskAttempts();
|
|
|
|
|
}
|
|
|
|
|
}, [task, isOpen]);
|
|
|
|
|
|
2025-06-24 10:32:30 +01:00
|
|
|
// Auto-scroll to bottom when activities or execution processes change
|
2025-06-24 10:27:30 +01:00
|
|
|
useEffect(() => {
|
|
|
|
|
if (shouldAutoScroll && scrollContainerRef.current) {
|
2025-06-24 16:50:58 +01:00
|
|
|
scrollContainerRef.current.scrollTop =
|
|
|
|
|
scrollContainerRef.current.scrollHeight;
|
2025-06-24 10:27:30 +01:00
|
|
|
}
|
2025-06-24 16:50:58 +01:00
|
|
|
}, [attemptData.activities, attemptData.processes, shouldAutoScroll]);
|
2025-06-24 10:27:30 +01:00
|
|
|
|
|
|
|
|
// Handle scroll events to detect manual scrolling
|
|
|
|
|
const handleScroll = useCallback(() => {
|
|
|
|
|
if (scrollContainerRef.current) {
|
2025-06-24 16:50:58 +01:00
|
|
|
const { scrollTop, scrollHeight, clientHeight } =
|
|
|
|
|
scrollContainerRef.current;
|
2025-06-24 10:27:30 +01:00
|
|
|
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 5; // 5px tolerance
|
2025-06-24 16:50:58 +01:00
|
|
|
|
2025-06-24 10:27:30 +01:00
|
|
|
if (isAtBottom && !shouldAutoScroll) {
|
|
|
|
|
setShouldAutoScroll(true);
|
|
|
|
|
} else if (!isAtBottom && shouldAutoScroll) {
|
|
|
|
|
setShouldAutoScroll(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, [shouldAutoScroll]);
|
|
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
const fetchTaskAttempts = async () => {
|
|
|
|
|
if (!task) return;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
const result: ApiResponse<TaskAttempt[]> = await response.json();
|
|
|
|
|
if (result.success && result.data) {
|
|
|
|
|
setTaskAttempts(result.data);
|
2025-06-21 17:36:07 +01:00
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
// Auto-select latest attempt
|
|
|
|
|
if (result.data.length > 0) {
|
|
|
|
|
const latestAttempt = result.data.reduce((latest, current) =>
|
|
|
|
|
new Date(current.created_at) > new Date(latest.created_at)
|
|
|
|
|
? current
|
|
|
|
|
: latest
|
|
|
|
|
);
|
|
|
|
|
setSelectedAttempt(latestAttempt);
|
2025-06-24 16:50:58 +01:00
|
|
|
fetchAttemptData(latestAttempt.id);
|
2025-06-21 22:55:12 +01:00
|
|
|
} else {
|
|
|
|
|
// Clear state when no attempts exist
|
|
|
|
|
setSelectedAttempt(null);
|
2025-06-24 16:50:58 +01:00
|
|
|
setAttemptData({
|
|
|
|
|
activities: [],
|
|
|
|
|
processes: [],
|
|
|
|
|
runningProcessDetails: {},
|
|
|
|
|
});
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error("Failed to fetch task attempts:", err);
|
|
|
|
|
} finally {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
const fetchAttemptData = async (
|
2025-06-21 17:36:07 +01:00
|
|
|
attemptId: string,
|
|
|
|
|
_isBackgroundUpdate = false
|
|
|
|
|
) => {
|
2025-06-21 16:49:16 +01:00
|
|
|
if (!task) return;
|
|
|
|
|
|
|
|
|
|
try {
|
2025-06-24 16:50:58 +01:00
|
|
|
const [activitiesResponse, processesResponse] = await Promise.all([
|
|
|
|
|
makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${attemptId}/activities`
|
|
|
|
|
),
|
|
|
|
|
makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${attemptId}/execution-processes`
|
|
|
|
|
),
|
|
|
|
|
]);
|
2025-06-21 16:49:16 +01:00
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
if (activitiesResponse.ok && processesResponse.ok) {
|
|
|
|
|
const activitiesResult: ApiResponse<TaskAttemptActivity[]> =
|
|
|
|
|
await activitiesResponse.json();
|
|
|
|
|
const processesResult: ApiResponse<ExecutionProcessSummary[]> =
|
|
|
|
|
await processesResponse.json();
|
2025-06-21 20:44:36 +01:00
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
if (
|
|
|
|
|
activitiesResult.success &&
|
|
|
|
|
processesResult.success &&
|
|
|
|
|
activitiesResult.data &&
|
|
|
|
|
processesResult.data
|
|
|
|
|
) {
|
|
|
|
|
// Find running activities that need detailed execution info
|
|
|
|
|
const runningActivities = activitiesResult.data.filter(
|
2025-06-21 20:44:36 +01:00
|
|
|
(activity) =>
|
|
|
|
|
activity.status === "setuprunning" ||
|
|
|
|
|
activity.status === "executorrunning"
|
|
|
|
|
);
|
|
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
// Fetch detailed execution info for running processes
|
|
|
|
|
const runningProcessDetails: Record<string, ExecutionProcess> = {};
|
2025-06-21 20:44:36 +01:00
|
|
|
for (const activity of runningActivities) {
|
2025-06-24 16:50:58 +01:00
|
|
|
try {
|
|
|
|
|
const detailResponse = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/execution-processes/${activity.execution_process_id}`
|
|
|
|
|
);
|
|
|
|
|
if (detailResponse.ok) {
|
|
|
|
|
const detailResult: ApiResponse<ExecutionProcess> =
|
|
|
|
|
await detailResponse.json();
|
|
|
|
|
if (detailResult.success && detailResult.data) {
|
|
|
|
|
runningProcessDetails[activity.execution_process_id] =
|
|
|
|
|
detailResult.data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(
|
|
|
|
|
`Failed to fetch execution process ${activity.execution_process_id}:`,
|
|
|
|
|
err
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-06-21 20:44:36 +01:00
|
|
|
}
|
|
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
// Update all attempt data at once
|
|
|
|
|
setAttemptData({
|
|
|
|
|
activities: activitiesResult.data,
|
|
|
|
|
processes: processesResult.data,
|
|
|
|
|
runningProcessDetails,
|
|
|
|
|
});
|
2025-06-21 20:44:36 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
2025-06-24 16:50:58 +01:00
|
|
|
console.error("Failed to fetch attempt data:", err);
|
2025-06-21 20:44:36 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
const handleAttemptChange = (attemptId: string) => {
|
2025-06-21 17:36:07 +01:00
|
|
|
const attempt = taskAttempts.find((a) => a.id === attemptId);
|
2025-06-21 16:49:16 +01:00
|
|
|
if (attempt) {
|
|
|
|
|
setSelectedAttempt(attempt);
|
2025-06-24 16:50:58 +01:00
|
|
|
fetchAttemptData(attempt.id);
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-22 22:41:16 +01:00
|
|
|
const openInEditor = async (editorType?: EditorType) => {
|
2025-06-21 16:49:16 +01:00
|
|
|
if (!task || !selectedAttempt) return;
|
|
|
|
|
|
|
|
|
|
try {
|
2025-06-22 22:41:16 +01:00
|
|
|
const response = await makeRequest(
|
2025-06-21 19:13:42 +01:00
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/open-editor`,
|
2025-06-21 16:49:16 +01:00
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
2025-06-22 22:41:16 +01:00
|
|
|
body: JSON.stringify(editorType ? { editor_type: editorType } : null),
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
);
|
2025-06-22 22:41:16 +01:00
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error("Failed to open editor");
|
|
|
|
|
}
|
2025-06-21 16:49:16 +01:00
|
|
|
} catch (err) {
|
2025-06-21 19:13:42 +01:00
|
|
|
console.error("Failed to open editor:", err);
|
2025-06-22 22:41:16 +01:00
|
|
|
// Show editor selection dialog if editor failed to open
|
|
|
|
|
if (!editorType) {
|
|
|
|
|
setShowEditorDialog(true);
|
|
|
|
|
}
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-24 16:50:58 +01:00
|
|
|
const startDevServer = async () => {
|
|
|
|
|
if (!task || !selectedAttempt || !project?.dev_script) return;
|
|
|
|
|
|
|
|
|
|
setIsStartingDevServer(true);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/start-dev-server`,
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error("Failed to start dev server");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const data: ApiResponse<null> = await response.json();
|
|
|
|
|
|
|
|
|
|
if (!data.success) {
|
|
|
|
|
throw new Error(data.message || "Failed to start dev server");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Refresh activities to show the new dev server process
|
|
|
|
|
fetchAttemptData(selectedAttempt.id);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error("Failed to start dev server:", err);
|
|
|
|
|
} finally {
|
|
|
|
|
setIsStartingDevServer(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const stopDevServer = async () => {
|
|
|
|
|
if (!task || !selectedAttempt || !runningDevServer) return;
|
|
|
|
|
|
|
|
|
|
setIsStartingDevServer(true);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/execution-processes/${runningDevServer.id}/stop`,
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error("Failed to stop dev server");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Refresh activities to show the stopped dev server
|
|
|
|
|
fetchAttemptData(selectedAttempt.id);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error("Failed to stop dev server:", err);
|
|
|
|
|
} finally {
|
|
|
|
|
setIsStartingDevServer(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 20:04:15 +01:00
|
|
|
const createNewAttempt = async (executor?: string) => {
|
2025-06-21 19:13:42 +01:00
|
|
|
if (!task) return;
|
2025-06-21 16:49:16 +01:00
|
|
|
|
|
|
|
|
try {
|
2025-06-21 19:13:42 +01:00
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts`,
|
2025-06-21 16:49:16 +01:00
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
2025-06-21 20:04:15 +01:00
|
|
|
body: JSON.stringify({
|
|
|
|
|
executor: executor || selectedExecutor,
|
|
|
|
|
}),
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
);
|
2025-06-21 19:13:42 +01:00
|
|
|
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
// Refresh the attempts list
|
|
|
|
|
fetchTaskAttempts();
|
|
|
|
|
}
|
2025-06-21 16:49:16 +01:00
|
|
|
} catch (err) {
|
2025-06-21 19:13:42 +01:00
|
|
|
console.error("Failed to create new attempt:", err);
|
2025-06-21 16:49:16 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 23:40:13 +01:00
|
|
|
const stopAllExecutions = async () => {
|
|
|
|
|
if (!task || !selectedAttempt) return;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
setIsStopping(true);
|
|
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/stop`,
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
// Refresh activities to show updated status
|
2025-06-24 16:50:58 +01:00
|
|
|
await fetchAttemptData(selectedAttempt.id);
|
2025-06-21 23:40:13 +01:00
|
|
|
// Wait a bit for the backend to finish updating
|
|
|
|
|
setTimeout(() => {
|
2025-06-24 16:50:58 +01:00
|
|
|
fetchAttemptData(selectedAttempt.id);
|
2025-06-21 23:40:13 +01:00
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error("Failed to stop executions:", err);
|
|
|
|
|
} finally {
|
|
|
|
|
setIsStopping(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 23:45:43 +01:00
|
|
|
const toggleOutputExpansion = (processId: string) => {
|
2025-06-22 21:41:02 +01:00
|
|
|
setExpandedOutputs((prev) => {
|
2025-06-21 23:45:43 +01:00
|
|
|
const newSet = new Set(prev);
|
|
|
|
|
if (newSet.has(processId)) {
|
|
|
|
|
newSet.delete(processId);
|
|
|
|
|
} else {
|
|
|
|
|
newSet.add(processId);
|
|
|
|
|
}
|
|
|
|
|
return newSet;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-24 01:05:55 +01:00
|
|
|
const handleSendFollowUp = async () => {
|
|
|
|
|
if (!task || !selectedAttempt || !followUpMessage.trim()) return;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
setIsSendingFollowUp(true);
|
2025-06-24 01:16:39 +01:00
|
|
|
setFollowUpError(null);
|
2025-06-24 01:05:55 +01:00
|
|
|
const response = await makeRequest(
|
|
|
|
|
`/api/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/follow-up`,
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify({
|
|
|
|
|
prompt: followUpMessage.trim(),
|
|
|
|
|
}),
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
// Clear the message
|
|
|
|
|
setFollowUpMessage("");
|
|
|
|
|
// Refresh activities to show the new follow-up execution
|
2025-06-24 16:50:58 +01:00
|
|
|
fetchAttemptData(selectedAttempt.id);
|
2025-06-24 01:05:55 +01:00
|
|
|
} else {
|
2025-06-24 01:16:39 +01:00
|
|
|
const errorText = await response.text();
|
2025-06-24 16:50:58 +01:00
|
|
|
setFollowUpError(
|
|
|
|
|
`Failed to start follow-up execution: ${
|
|
|
|
|
errorText || response.statusText
|
|
|
|
|
}`
|
|
|
|
|
);
|
2025-06-24 01:05:55 +01:00
|
|
|
}
|
|
|
|
|
} catch (err) {
|
2025-06-24 16:50:58 +01:00
|
|
|
setFollowUpError(
|
|
|
|
|
`Failed to send follow-up: ${
|
|
|
|
|
err instanceof Error ? err.message : "Unknown error"
|
|
|
|
|
}`
|
|
|
|
|
);
|
2025-06-24 01:05:55 +01:00
|
|
|
} finally {
|
|
|
|
|
setIsSendingFollowUp(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
if (!task) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{isOpen && (
|
|
|
|
|
<>
|
2025-06-21 18:00:28 +01:00
|
|
|
{/* Backdrop - only on smaller screens (overlay mode) */}
|
2025-06-21 19:13:42 +01:00
|
|
|
<div className={getBackdropClasses()} onClick={onClose} />
|
2025-06-21 17:36:07 +01:00
|
|
|
|
2025-06-21 16:49:16 +01:00
|
|
|
{/* Panel */}
|
2025-06-21 19:13:42 +01:00
|
|
|
<div className={getTaskPanelClasses()}>
|
2025-06-21 16:49:16 +01:00
|
|
|
<div className="flex flex-col h-full">
|
2025-06-21 17:36:07 +01:00
|
|
|
{/* Header */}
|
2025-06-24 16:57:45 +01:00
|
|
|
<div className="border-b">
|
|
|
|
|
{/* Title and Task Actions */}
|
|
|
|
|
<div className="p-6 pb-4">
|
|
|
|
|
<div className="flex items-start justify-between">
|
|
|
|
|
<div className="flex-1 min-w-0">
|
|
|
|
|
<h2 className="text-xl font-bold mb-2 line-clamp-2">
|
|
|
|
|
{task.title}
|
|
|
|
|
</h2>
|
|
|
|
|
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
|
|
|
<Chip dotColor={getTaskStatusDotColor(task.status)}>
|
|
|
|
|
{statusLabels[task.status]}
|
|
|
|
|
</Chip>
|
|
|
|
|
</div>
|
2025-06-21 17:36:07 +01:00
|
|
|
</div>
|
2025-06-24 16:57:45 +01:00
|
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
{onEditTask && (
|
2025-06-24 17:09:15 +01:00
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon"
|
|
|
|
|
onClick={() => onEditTask(task)}
|
|
|
|
|
>
|
|
|
|
|
<Edit className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>Edit task</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
2025-06-24 16:57:45 +01:00
|
|
|
)}
|
|
|
|
|
{onDeleteTask && (
|
2025-06-24 17:09:15 +01:00
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon"
|
|
|
|
|
onClick={() => onDeleteTask(task.id)}
|
|
|
|
|
>
|
|
|
|
|
<Trash2 className="h-4 w-4 text-red-500" />
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>Delete task</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
2025-06-24 16:57:45 +01:00
|
|
|
)}
|
2025-06-24 17:09:15 +01:00
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button variant="ghost" size="icon" onClick={onClose}>
|
|
|
|
|
<X className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>Close panel</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
2025-06-24 16:57:45 +01:00
|
|
|
</div>
|
2025-06-21 16:49:16 +01:00
|
|
|
</div>
|
|
|
|
|
|
2025-06-24 16:57:45 +01:00
|
|
|
{/* Description */}
|
|
|
|
|
<div className="mt-4">
|
|
|
|
|
<div className="p-3 bg-muted/30 rounded-md">
|
|
|
|
|
{task.description ? (
|
|
|
|
|
<div>
|
|
|
|
|
<p
|
|
|
|
|
className={`text-sm whitespace-pre-wrap ${
|
|
|
|
|
!isDescriptionExpanded &&
|
|
|
|
|
task.description.length > 200
|
|
|
|
|
? "line-clamp-6"
|
|
|
|
|
: ""
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
{task.description}
|
|
|
|
|
</p>
|
|
|
|
|
{task.description.length > 200 && (
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() =>
|
|
|
|
|
setIsDescriptionExpanded(!isDescriptionExpanded)
|
|
|
|
|
}
|
|
|
|
|
className="mt-2 p-0 h-auto text-xs text-muted-foreground hover:text-foreground"
|
|
|
|
|
>
|
|
|
|
|
{isDescriptionExpanded ? (
|
|
|
|
|
<>
|
|
|
|
|
<ChevronUp className="h-3 w-3 mr-1" />
|
|
|
|
|
Show less
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<ChevronDown className="h-3 w-3 mr-1" />
|
|
|
|
|
Show more
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<p className="text-sm text-muted-foreground italic">
|
|
|
|
|
No description provided
|
2025-06-21 19:13:42 +01:00
|
|
|
</p>
|
2025-06-24 16:57:45 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Integrated Toolbar */}
|
|
|
|
|
<div className="px-6 pb-4">
|
|
|
|
|
<div className="flex items-center justify-between gap-4 p-3 bg-muted/20 rounded-lg border">
|
|
|
|
|
{/* Current Attempt Info */}
|
|
|
|
|
<div className="flex items-center gap-3 min-w-0 flex-1">
|
|
|
|
|
{selectedAttempt ? (
|
|
|
|
|
<>
|
|
|
|
|
<div className="text-sm">
|
|
|
|
|
<span className="font-medium">
|
|
|
|
|
{new Date(selectedAttempt.created_at).toLocaleDateString()}{" "}
|
|
|
|
|
{new Date(selectedAttempt.created_at).toLocaleTimeString([], {
|
|
|
|
|
hour: "2-digit",
|
|
|
|
|
minute: "2-digit",
|
|
|
|
|
})}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="text-muted-foreground ml-2">
|
|
|
|
|
({selectedAttempt.executor || "executor"})
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="h-4 w-px bg-border" />
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="text-sm text-muted-foreground">
|
|
|
|
|
No attempts yet
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Action Button Groups */}
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
{/* Attempt Management Group */}
|
|
|
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
{taskAttempts.length > 1 && (
|
2025-06-24 17:14:05 +01:00
|
|
|
<DropdownMenu>
|
|
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
2025-06-24 17:09:15 +01:00
|
|
|
<DropdownMenuTrigger asChild>
|
|
|
|
|
<Button variant="outline" size="sm">
|
|
|
|
|
<History className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</DropdownMenuTrigger>
|
2025-06-24 17:14:05 +01:00
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>View attempt history</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
|
|
|
|
<DropdownMenuContent align="start" className="w-64">
|
|
|
|
|
{taskAttempts.map((attempt) => (
|
|
|
|
|
<DropdownMenuItem
|
|
|
|
|
key={attempt.id}
|
|
|
|
|
onClick={() => handleAttemptChange(attempt.id)}
|
|
|
|
|
className={
|
|
|
|
|
selectedAttempt?.id === attempt.id
|
|
|
|
|
? "bg-accent"
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex flex-col w-full">
|
|
|
|
|
<span className="font-medium text-sm">
|
|
|
|
|
{new Date(
|
|
|
|
|
attempt.created_at
|
|
|
|
|
).toLocaleDateString()}{" "}
|
|
|
|
|
{new Date(
|
|
|
|
|
attempt.created_at
|
|
|
|
|
).toLocaleTimeString()}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{attempt.executor || "executor"}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
))}
|
|
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
2025-06-24 16:57:45 +01:00
|
|
|
)}
|
|
|
|
|
<div className="flex">
|
2025-06-24 17:09:15 +01:00
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => createNewAttempt()}
|
|
|
|
|
className="rounded-r-none border-r-0"
|
2025-06-24 16:57:45 +01:00
|
|
|
>
|
2025-06-24 17:09:15 +01:00
|
|
|
{selectedAttempt ? "Retry" : "Start"}
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>{selectedAttempt ? "Retry task with current executor" : "Start task with current executor"}</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
2025-06-24 17:14:05 +01:00
|
|
|
<DropdownMenu>
|
|
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
2025-06-24 17:09:15 +01:00
|
|
|
<DropdownMenuTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
className="rounded-l-none px-2"
|
|
|
|
|
>
|
|
|
|
|
<Settings2 className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</DropdownMenuTrigger>
|
2025-06-24 17:14:05 +01:00
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>Choose executor</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
|
|
|
|
<DropdownMenuContent align="end">
|
|
|
|
|
{availableExecutors.map((executor) => (
|
|
|
|
|
<DropdownMenuItem
|
|
|
|
|
key={executor.id}
|
|
|
|
|
onClick={() => setSelectedExecutor(executor.id)}
|
|
|
|
|
className={
|
|
|
|
|
selectedExecutor === executor.id
|
|
|
|
|
? "bg-accent"
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{executor.name}
|
|
|
|
|
{config?.executor.type === executor.id &&
|
|
|
|
|
" (Default)"}
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
))}
|
|
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
2025-06-24 16:57:45 +01:00
|
|
|
</div>
|
2025-06-21 19:13:42 +01:00
|
|
|
</div>
|
|
|
|
|
|
2025-06-24 16:57:45 +01:00
|
|
|
{selectedAttempt && (
|
|
|
|
|
<>
|
|
|
|
|
<div className="h-4 w-px bg-border" />
|
|
|
|
|
|
|
|
|
|
{/* Execution Control Group */}
|
|
|
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
{(isAttemptRunning || isStopping) && (
|
2025-06-24 17:09:15 +01:00
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={stopAllExecutions}
|
|
|
|
|
disabled={isStopping}
|
|
|
|
|
className="text-red-600 hover:text-red-700 hover:bg-red-50 disabled:opacity-50"
|
|
|
|
|
>
|
|
|
|
|
<StopCircle className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>{isStopping ? "Stopping execution..." : "Stop execution"}</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
2025-06-24 16:57:45 +01:00
|
|
|
)}
|
|
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<span
|
|
|
|
|
className={
|
|
|
|
|
!project?.dev_script ? "cursor-not-allowed" : ""
|
|
|
|
|
}
|
|
|
|
|
onMouseEnter={() => setIsHoveringDevServer(true)}
|
|
|
|
|
onMouseLeave={() => setIsHoveringDevServer(false)}
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
variant={
|
|
|
|
|
runningDevServer ? "destructive" : "outline"
|
|
|
|
|
}
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={
|
|
|
|
|
runningDevServer
|
|
|
|
|
? stopDevServer
|
|
|
|
|
: startDevServer
|
|
|
|
|
}
|
|
|
|
|
disabled={
|
|
|
|
|
isStartingDevServer || !project?.dev_script
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{runningDevServer ? (
|
|
|
|
|
<StopCircle className="h-4 w-4" />
|
|
|
|
|
) : (
|
|
|
|
|
<Play className="h-4 w-4" />
|
|
|
|
|
)}
|
|
|
|
|
</Button>
|
2025-06-21 19:13:42 +01:00
|
|
|
</span>
|
2025-06-24 16:57:45 +01:00
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent
|
|
|
|
|
className={runningDevServer ? "max-w-2xl p-4" : ""}
|
|
|
|
|
side="top"
|
|
|
|
|
align="center"
|
|
|
|
|
avoidCollisions={true}
|
|
|
|
|
>
|
|
|
|
|
{!project?.dev_script ? (
|
|
|
|
|
<p>
|
|
|
|
|
Configure a dev server command in project
|
|
|
|
|
settings
|
|
|
|
|
</p>
|
|
|
|
|
) : runningDevServer && devServerDetails ? (
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<p className="text-sm font-medium">
|
|
|
|
|
Dev Server Logs (Last 10 lines):
|
|
|
|
|
</p>
|
|
|
|
|
<pre className="text-xs bg-muted p-2 rounded max-h-64 overflow-y-auto whitespace-pre-wrap">
|
2025-06-24 17:35:21 +01:00
|
|
|
{processedDevServerLogs}
|
2025-06-24 16:57:45 +01:00
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
) : runningDevServer ? (
|
|
|
|
|
<p>Stop the running dev server</p>
|
|
|
|
|
) : (
|
|
|
|
|
<p>Start the dev server</p>
|
|
|
|
|
)}
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="h-4 w-px bg-border" />
|
|
|
|
|
|
|
|
|
|
{/* Code Actions Group */}
|
|
|
|
|
<div className="flex items-center gap-1">
|
2025-06-24 17:09:15 +01:00
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => openInEditor()}
|
|
|
|
|
>
|
|
|
|
|
<Code className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>Open in editor</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
|
|
|
|
<TooltipProvider>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button variant="outline" size="sm" asChild>
|
|
|
|
|
<Link
|
|
|
|
|
to={`/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/compare`}
|
|
|
|
|
>
|
|
|
|
|
<GitCompare className="h-4 w-4" />
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent>
|
|
|
|
|
<p>View code changes</p>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</TooltipProvider>
|
2025-06-24 16:57:45 +01:00
|
|
|
</div>
|
|
|
|
|
</>
|
2025-06-21 23:40:13 +01:00
|
|
|
)}
|
2025-06-21 17:36:07 +01:00
|
|
|
</div>
|
2025-06-24 16:57:45 +01:00
|
|
|
</div>
|
2025-06-21 17:36:07 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Content */}
|
2025-06-24 16:50:58 +01:00
|
|
|
<div
|
2025-06-24 10:27:30 +01:00
|
|
|
ref={scrollContainerRef}
|
|
|
|
|
onScroll={handleScroll}
|
|
|
|
|
className="flex-1 overflow-y-auto p-6 space-y-6"
|
|
|
|
|
>
|
2025-06-21 17:36:07 +01:00
|
|
|
{loading ? (
|
|
|
|
|
<div className="text-center py-8">
|
|
|
|
|
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-foreground mx-auto mb-4"></div>
|
|
|
|
|
<p className="text-muted-foreground">Loading...</p>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
{/* Activity History */}
|
|
|
|
|
{selectedAttempt && (
|
|
|
|
|
<div>
|
|
|
|
|
<Label className="text-sm font-medium mb-3 block">
|
|
|
|
|
Activity History
|
|
|
|
|
</Label>
|
2025-06-24 16:50:58 +01:00
|
|
|
{attemptData.activities.length === 0 ? (
|
2025-06-21 17:36:07 +01:00
|
|
|
<div className="text-center py-4 text-muted-foreground">
|
|
|
|
|
No activities found
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
2025-06-21 20:44:36 +01:00
|
|
|
<div className="space-y-2">
|
2025-06-22 21:57:22 +01:00
|
|
|
{/* Fake worktree created activity */}
|
|
|
|
|
{selectedAttempt && (
|
|
|
|
|
<div key="worktree-created">
|
|
|
|
|
<div className="flex items-center gap-3 my-4 rounded-md">
|
|
|
|
|
<Chip dotColor="bg-green-500">
|
2025-06-22 22:00:45 +01:00
|
|
|
New Worktree
|
2025-06-22 21:57:22 +01:00
|
|
|
</Chip>
|
|
|
|
|
<span className="text-sm text-muted-foreground flex-1">
|
2025-06-22 22:00:45 +01:00
|
|
|
{selectedAttempt.worktree_path}
|
2025-06-22 21:57:22 +01:00
|
|
|
</span>
|
|
|
|
|
<div className="flex items-center gap-1 text-xs text-muted-foreground">
|
|
|
|
|
<Clock className="h-3 w-3" />
|
|
|
|
|
{new Date(
|
|
|
|
|
selectedAttempt.created_at
|
|
|
|
|
).toLocaleTimeString([], {
|
|
|
|
|
hour: "2-digit",
|
|
|
|
|
minute: "2-digit",
|
|
|
|
|
second: "2-digit",
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2025-06-24 16:50:58 +01:00
|
|
|
{attemptData.activities.slice().map((activity) => (
|
2025-06-21 20:44:36 +01:00
|
|
|
<div key={activity.id}>
|
|
|
|
|
{/* Compact activity message */}
|
|
|
|
|
<div className="flex items-center gap-3 my-4 rounded-md">
|
|
|
|
|
<Chip
|
|
|
|
|
dotColor={
|
|
|
|
|
getAttemptStatusDisplay(activity.status)
|
|
|
|
|
.dotColor
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
getAttemptStatusDisplay(activity.status)
|
|
|
|
|
.label
|
|
|
|
|
}
|
|
|
|
|
</Chip>
|
2025-06-21 17:36:07 +01:00
|
|
|
{activity.note && (
|
2025-06-21 20:44:36 +01:00
|
|
|
<span className="text-sm text-muted-foreground flex-1">
|
2025-06-21 17:36:07 +01:00
|
|
|
{activity.note}
|
2025-06-21 20:44:36 +01:00
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
<div className="flex items-center gap-1 text-xs text-muted-foreground">
|
|
|
|
|
<Clock className="h-3 w-3" />
|
|
|
|
|
{new Date(
|
|
|
|
|
activity.created_at
|
|
|
|
|
).toLocaleTimeString([], {
|
|
|
|
|
hour: "2-digit",
|
|
|
|
|
minute: "2-digit",
|
|
|
|
|
second: "2-digit",
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Show stdio output for running processes */}
|
|
|
|
|
{(activity.status === "setuprunning" ||
|
|
|
|
|
activity.status === "executorrunning") &&
|
2025-06-24 16:50:58 +01:00
|
|
|
attemptData.runningProcessDetails[
|
2025-06-21 20:44:36 +01:00
|
|
|
activity.execution_process_id
|
|
|
|
|
] && (
|
2025-06-21 22:12:32 +01:00
|
|
|
<div className="mt-2">
|
2025-06-22 21:41:02 +01:00
|
|
|
<div
|
2025-06-24 16:50:58 +01:00
|
|
|
className={`transition-all duration-200 ${
|
|
|
|
|
expandedOutputs.has(
|
|
|
|
|
activity.execution_process_id
|
|
|
|
|
)
|
|
|
|
|
? ""
|
|
|
|
|
: "max-h-64 overflow-hidden flex flex-col justify-end"
|
|
|
|
|
}`}
|
2025-06-21 23:45:43 +01:00
|
|
|
>
|
|
|
|
|
<ExecutionOutputViewer
|
|
|
|
|
executionProcess={
|
2025-06-24 16:50:58 +01:00
|
|
|
attemptData.runningProcessDetails[
|
2025-06-21 23:45:43 +01:00
|
|
|
activity.execution_process_id
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
executor={
|
2025-06-22 21:41:02 +01:00
|
|
|
selectedAttempt?.executor ||
|
|
|
|
|
undefined
|
2025-06-21 23:45:43 +01:00
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
2025-06-22 21:41:02 +01:00
|
|
|
onClick={() =>
|
|
|
|
|
toggleOutputExpansion(
|
|
|
|
|
activity.execution_process_id
|
|
|
|
|
)
|
|
|
|
|
}
|
2025-06-21 23:45:43 +01:00
|
|
|
className="mt-2 p-0 h-auto text-xs text-muted-foreground hover:text-foreground"
|
|
|
|
|
>
|
2025-06-22 21:41:02 +01:00
|
|
|
{expandedOutputs.has(
|
|
|
|
|
activity.execution_process_id
|
|
|
|
|
) ? (
|
2025-06-21 23:45:43 +01:00
|
|
|
<>
|
|
|
|
|
<ChevronUp className="h-3 w-3 mr-1" />
|
|
|
|
|
Show less
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<ChevronDown className="h-3 w-3 mr-1" />
|
|
|
|
|
Show more
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</Button>
|
2025-06-21 22:12:32 +01:00
|
|
|
</div>
|
2025-06-21 17:36:07 +01:00
|
|
|
)}
|
2025-06-21 20:44:36 +01:00
|
|
|
</div>
|
2025-06-21 17:36:07 +01:00
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2025-06-21 16:49:16 +01:00
|
|
|
</div>
|
|
|
|
|
)}
|
2025-06-21 17:36:07 +01:00
|
|
|
</>
|
2025-06-21 16:49:16 +01:00
|
|
|
)}
|
2025-06-21 17:36:07 +01:00
|
|
|
</div>
|
2025-06-21 16:49:16 +01:00
|
|
|
|
2025-06-24 01:05:55 +01:00
|
|
|
{/* Footer - Follow-up section */}
|
|
|
|
|
{selectedAttempt && (
|
|
|
|
|
<div className="border-t p-4">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm font-medium">
|
|
|
|
|
Follow-up question
|
|
|
|
|
</Label>
|
2025-06-24 01:16:39 +01:00
|
|
|
{followUpError && (
|
|
|
|
|
<Alert variant="destructive">
|
|
|
|
|
<AlertCircle className="h-4 w-4" />
|
|
|
|
|
<AlertDescription>{followUpError}</AlertDescription>
|
|
|
|
|
</Alert>
|
|
|
|
|
)}
|
2025-06-24 01:05:55 +01:00
|
|
|
<div className="flex gap-2">
|
2025-06-24 17:34:31 +01:00
|
|
|
<FileSearchTextarea
|
|
|
|
|
placeholder="Ask a follow-up question about this task... Type @ to search files."
|
2025-06-24 01:05:55 +01:00
|
|
|
value={followUpMessage}
|
2025-06-24 17:34:31 +01:00
|
|
|
onChange={(value) => {
|
|
|
|
|
setFollowUpMessage(value);
|
2025-06-24 01:16:39 +01:00
|
|
|
if (followUpError) setFollowUpError(null);
|
|
|
|
|
}}
|
2025-06-24 01:05:55 +01:00
|
|
|
onKeyDown={(e) => {
|
2025-06-24 16:50:58 +01:00
|
|
|
if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
|
2025-06-24 01:05:55 +01:00
|
|
|
e.preventDefault();
|
2025-06-24 16:50:58 +01:00
|
|
|
if (
|
|
|
|
|
canSendFollowUp &&
|
|
|
|
|
followUpMessage.trim() &&
|
|
|
|
|
!isSendingFollowUp
|
|
|
|
|
) {
|
2025-06-24 01:05:55 +01:00
|
|
|
handleSendFollowUp();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
className="flex-1 min-h-[60px] resize-none"
|
|
|
|
|
disabled={!canSendFollowUp}
|
2025-06-24 17:34:31 +01:00
|
|
|
projectId={projectId}
|
|
|
|
|
rows={3}
|
2025-06-24 01:05:55 +01:00
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
onClick={handleSendFollowUp}
|
2025-06-24 16:50:58 +01:00
|
|
|
disabled={
|
|
|
|
|
!canSendFollowUp ||
|
|
|
|
|
!followUpMessage.trim() ||
|
|
|
|
|
isSendingFollowUp
|
|
|
|
|
}
|
2025-06-24 01:05:55 +01:00
|
|
|
className="self-end"
|
|
|
|
|
>
|
|
|
|
|
{isSendingFollowUp ? (
|
|
|
|
|
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-current" />
|
|
|
|
|
) : (
|
|
|
|
|
<Send className="h-4 w-4" />
|
|
|
|
|
)}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
{!canSendFollowUp
|
|
|
|
|
? isAttemptRunning
|
|
|
|
|
? "Wait for current execution to complete before asking follow-up questions"
|
|
|
|
|
: "Complete at least one coding agent execution to enable follow-up questions"
|
|
|
|
|
: "Continue the conversation with the most recent executor session"}
|
|
|
|
|
</p>
|
2025-06-21 17:36:07 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-06-24 01:05:55 +01:00
|
|
|
)}
|
2025-06-21 16:49:16 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-06-22 22:41:16 +01:00
|
|
|
|
|
|
|
|
{/* Editor Selection Dialog */}
|
|
|
|
|
<EditorSelectionDialog
|
|
|
|
|
isOpen={showEditorDialog}
|
|
|
|
|
onClose={() => setShowEditorDialog(false)}
|
|
|
|
|
onSelectEditor={(editorType) => openInEditor(editorType)}
|
|
|
|
|
/>
|
2025-06-21 16:49:16 +01:00
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|