"use client"; import { useCallback, useState } from "react"; import { IconEdit, IconInfoCircle, IconRefresh } from "@tabler/icons-react"; import { Button } from "@kandev/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@kandev/ui/dialog"; import { Label } from "@kandev/ui/label"; import { Switch } from "@kandev/ui/switch"; import { Textarea } from "@kandev/ui/textarea"; import { Tooltip, TooltipContent, TooltipTrigger } from "@kandev/ui/tooltip"; import { useToast } from "@/components/toast-provider"; import { useTaskCIAutomationOptions } from "@/hooks/domains/github/use-task-ci-options"; import type { TaskCIAutomationPatch, TaskPR } from "@/lib/types/github"; const PR_FEEDBACK_PLACEHOLDER = "{{pr.feedback}}"; function CIAutomationInfoButton() { return ( Watches this task's linked pull request during the 1 minute PR refresh loop. Auto-fix queues a task prompt for new failed checks and unresolved review comments when the prompt includes the PR feedback placeholder, then snapshots what was handled so the next round only sends newly observed issues. Auto-merge runs only after CI, review, and mergeability are ready. ); } function insertPRFeedbackPlaceholder(prompt: string) { if (prompt.includes(PR_FEEDBACK_PLACEHOLDER)) return prompt; const trimmedEnd = prompt.trimEnd(); if (!trimmedEnd) return PR_FEEDBACK_PLACEHOLDER; return `${trimmedEnd}\n\n${PR_FEEDBACK_PLACEHOLDER}`; } function CIAutomationPromptDialog({ open, prompt, saving, onPromptChange, onClose, onSave, onReset, }: { open: boolean; prompt: string; saving: boolean; onPromptChange: (value: string) => void; onClose: () => void; onSave: () => void; onReset: () => void; }) { const trimmed = prompt.trim(); return ( !next && onClose()}> Auto-fix prompt This prompt is used only for this task. Leave it blank to use the default prompt. Add{" "} {PR_FEEDBACK_PLACEHOLDER} {" "} when you want Kandev to include its PR feedback snapshot.
e.stopPropagation()} > Edit default prompt

The placeholder inserts the current PR identifier, new or changed failing checks with GitHub job links, and new or changed review comments with file, line, and body text.

Omit the placeholder if you want the agent to pull or fetch the branch and inspect GitHub itself instead of receiving Kandev's snapshot.