Display executor

This commit is contained in:
Louis Knight-Webb
2025-06-16 20:38:20 -04:00
parent 73af2b6fd9
commit cba8da0816
2 changed files with 12 additions and 15 deletions

View File

@@ -23,7 +23,6 @@ import type {
TaskStatus, TaskStatus,
TaskAttempt, TaskAttempt,
TaskAttemptActivity, TaskAttemptActivity,
ExecutorConfig,
} from "shared/types"; } from "shared/types";
interface Task { interface Task {
@@ -74,9 +73,7 @@ export function TaskDetailsDialog({
TaskAttemptActivity[] TaskAttemptActivity[]
>([]); >([]);
const [activitiesLoading, setActivitiesLoading] = useState(false); const [activitiesLoading, setActivitiesLoading] = useState(false);
const [selectedExecutor, setSelectedExecutor] = useState<ExecutorConfig>({ const [selectedExecutor, setSelectedExecutor] = useState<string>("echo");
type: "echo",
});
const [creatingAttempt, setCreatingAttempt] = useState(false); const [creatingAttempt, setCreatingAttempt] = useState(false);
// Edit mode state // Edit mode state
@@ -111,7 +108,9 @@ export function TaskDetailsDialog({
// Automatically select the latest attempt if available // Automatically select the latest attempt if available
if (result.data.length > 0) { if (result.data.length > 0) {
const latestAttempt = result.data.reduce((latest, current) => const latestAttempt = result.data.reduce((latest, current) =>
new Date(current.created_at) > new Date(latest.created_at) ? current : latest new Date(current.created_at) > new Date(latest.created_at)
? current
: latest
); );
setSelectedAttempt(latestAttempt); setSelectedAttempt(latestAttempt);
fetchAttemptActivities(latestAttempt.id); fetchAttemptActivities(latestAttempt.id);
@@ -219,7 +218,7 @@ export function TaskDetailsDialog({
worktree_path: worktreePath, worktree_path: worktreePath,
base_commit: null, base_commit: null,
merge_commit: null, merge_commit: null,
executor_config: selectedExecutor, executor: selectedExecutor,
}), }),
} }
); );
@@ -499,8 +498,8 @@ export function TaskDetailsDialog({
attempt.created_at attempt.created_at
).toLocaleTimeString()} ).toLocaleTimeString()}
</span> </span>
<span className="text-xs text-muted-foreground"> <span className="text-xs text-muted-foreground text-left">
Executor {attempt.executor || "executor"}
</span> </span>
</div> </div>
</SelectItem> </SelectItem>
@@ -518,11 +517,9 @@ export function TaskDetailsDialog({
</Label> </Label>
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
<Select <Select
value={selectedExecutor.type} value={selectedExecutor}
onValueChange={(value) => onValueChange={(value) =>
setSelectedExecutor({ setSelectedExecutor(value as "echo" | "claude")
type: value as "echo" | "claude",
})
} }
> >
<SelectTrigger> <SelectTrigger>

View File

@@ -21,9 +21,9 @@ export type UpdateTask = { title: string | null, description: string | null, sta
export type TaskAttemptStatus = "init" | "inprogress" | "paused"; export type TaskAttemptStatus = "init" | "inprogress" | "paused";
export type TaskAttempt = { id: string, task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, stdout: string | null, stderr: string | null, created_at: string, updated_at: string, }; export type TaskAttempt = { id: string, task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, executor: string | null, stdout: string | null, stderr: string | null, created_at: string, updated_at: string, };
export type CreateTaskAttempt = { task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, executor_config: ExecutorConfig | null, }; export type CreateTaskAttempt = { task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, executor: string | null, };
export type UpdateTaskAttempt = { worktree_path: string | null, base_commit: string | null, merge_commit: string | null, }; export type UpdateTaskAttempt = { worktree_path: string | null, base_commit: string | null, merge_commit: string | null, };