suchintan.vibe code user goal check (#2349)

Co-authored-by: lawyzheng <lawyzheng1106@gmail.com>
This commit is contained in:
Shuchang Zheng
2025-05-15 08:18:24 -07:00
committed by GitHub
parent 847ddacebd
commit ed4280153f
30 changed files with 251 additions and 9 deletions

View File

@@ -24,6 +24,8 @@ export const baseHelpTooltipContent = {
continueOnFailure:
"Allow the workflow to continue if it encounters a failure.",
cacheActions: "Cache the actions of this block.",
includeActionHistoryInVerification:
"Include the action history in the completion verification.",
} as const;
export const basePlaceholderContent = {

View File

@@ -56,6 +56,7 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
totpIdentifier: data.totpIdentifier,
completeCriterion: data.completeCriterion,
terminateCriterion: data.terminateCriterion,
includeActionHistoryInVerification: data.includeActionHistoryInVerification,
});
const deleteNodeCallback = useDeleteNodeCallback();
@@ -257,6 +258,31 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
)}
</div>
<Separator />
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">
Include Action History
</Label>
<HelpTooltip
content={
helpTooltips["navigation"][
"includeActionHistoryInVerification"
]
}
/>
</div>
<div className="w-52">
<Switch
checked={inputs.includeActionHistoryInVerification}
onCheckedChange={(checked) => {
handleChange(
"includeActionHistoryInVerification",
checked,
);
}}
/>
</div>
</div>
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">

View File

@@ -15,6 +15,7 @@ export type NavigationNodeData = NodeBaseData & {
totpVerificationUrl: string | null;
totpIdentifier: string | null;
cacheActions: boolean;
includeActionHistoryInVerification: boolean;
};
export type NavigationNode = Node<NavigationNodeData, "navigation">;
@@ -36,6 +37,7 @@ export const navigationNodeDefaultData: NavigationNodeData = {
totpIdentifier: null,
continueOnFailure: false,
cacheActions: false,
includeActionHistoryInVerification: false,
} as const;
export function isNavigationNode(node: Node): node is NavigationNode {

View File

@@ -66,6 +66,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
errorCodeMapping: data.errorCodeMapping,
totpVerificationUrl: data.totpVerificationUrl,
totpIdentifier: data.totpIdentifier,
includeActionHistoryInVerification: data.includeActionHistoryInVerification,
});
function handleChange(key: string, value: unknown) {
@@ -290,6 +291,31 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
)}
</div>
<Separator />
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">
Include Action History
</Label>
<HelpTooltip
content={
helpTooltips["task"][
"includeActionHistoryInVerification"
]
}
/>
</div>
<div className="w-52">
<Switch
checked={inputs.includeActionHistoryInVerification}
onCheckedChange={(checked) => {
handleChange(
"includeActionHistoryInVerification",
checked,
);
}}
/>
</div>
</div>
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">

View File

@@ -17,6 +17,7 @@ export type TaskNodeData = NodeBaseData & {
totpVerificationUrl: string | null;
totpIdentifier: string | null;
cacheActions: boolean;
includeActionHistoryInVerification: boolean;
};
export type TaskNode = Node<TaskNodeData, "task">;
@@ -40,6 +41,7 @@ export const taskNodeDefaultData: TaskNodeData = {
totpIdentifier: null,
continueOnFailure: false,
cacheActions: false,
includeActionHistoryInVerification: false,
} as const;
export function isTaskNode(node: Node): node is TaskNode {

View File

@@ -232,6 +232,8 @@ function convertToNode(
cacheActions: block.cache_actions,
completeCriterion: block.complete_criterion ?? "",
terminateCriterion: block.terminate_criterion ?? "",
includeActionHistoryInVerification:
block.include_action_history_in_verification ?? false,
},
};
}
@@ -304,6 +306,8 @@ function convertToNode(
maxStepsOverride: block.max_steps_per_run ?? null,
completeCriterion: block.complete_criterion ?? "",
terminateCriterion: block.terminate_criterion ?? "",
includeActionHistoryInVerification:
block.include_action_history_in_verification ?? false,
},
};
}
@@ -975,6 +979,8 @@ function getWorkflowBlock(node: WorkflowBlockNode): BlockYAML {
totp_identifier: node.data.totpIdentifier,
totp_verification_url: node.data.totpVerificationUrl,
cache_actions: node.data.cacheActions,
include_action_history_in_verification:
node.data.includeActionHistoryInVerification,
};
}
case "taskv2": {
@@ -1046,6 +1052,8 @@ function getWorkflowBlock(node: WorkflowBlockNode): BlockYAML {
cache_actions: node.data.cacheActions,
complete_criterion: node.data.completeCriterion,
terminate_criterion: node.data.terminateCriterion,
include_action_history_in_verification:
node.data.includeActionHistoryInVerification,
};
}
case "extraction": {
@@ -1703,6 +1711,8 @@ function convertBlocksToBlockYAML(
totp_identifier: block.totp_identifier,
totp_verification_url: block.totp_verification_url,
cache_actions: block.cache_actions,
include_action_history_in_verification:
block.include_action_history_in_verification,
};
return blockYaml;
}
@@ -1765,6 +1775,8 @@ function convertBlocksToBlockYAML(
cache_actions: block.cache_actions,
complete_criterion: block.complete_criterion,
terminate_criterion: block.terminate_criterion,
include_action_history_in_verification:
block.include_action_history_in_verification,
};
return blockYaml;
}

View File

@@ -40,6 +40,7 @@ export type WorkflowRunBlock = {
data_schema: object | Array<unknown> | string | null;
terminate_criterion: string | null;
complete_criterion: string | null;
include_action_history_in_verification: boolean | null;
actions: Array<ActionsApiResponse> | null;
recipients?: Array<string> | null;
attachments?: Array<string> | null;

View File

@@ -251,6 +251,7 @@ export type TaskBlock = WorkflowBlockBase & {
totp_verification_url?: string | null;
totp_identifier?: string | null;
cache_actions: boolean;
include_action_history_in_verification: boolean;
};
export type Taskv2Block = WorkflowBlockBase & {
@@ -363,6 +364,7 @@ export type NavigationBlock = WorkflowBlockBase & {
cache_actions: boolean;
complete_criterion: string | null;
terminate_criterion: string | null;
include_action_history_in_verification: boolean;
};
export type ExtractionBlock = WorkflowBlockBase & {

View File

@@ -134,6 +134,7 @@ export type TaskBlockYAML = BlockYAMLBase & {
cache_actions: boolean;
complete_criterion: string | null;
terminate_criterion: string | null;
include_action_history_in_verification: boolean;
};
export type Taskv2BlockYAML = BlockYAMLBase & {
@@ -184,6 +185,7 @@ export type NavigationBlockYAML = BlockYAMLBase & {
cache_actions: boolean;
complete_criterion: string | null;
terminate_criterion: string | null;
include_action_history_in_verification: boolean;
};
export type ExtractionBlockYAML = BlockYAMLBase & {

View File

@@ -3,6 +3,7 @@ import { Input } from "@/components/ui/input";
import { CodeEditor } from "@/routes/workflows/components/CodeEditor";
import { WorkflowRunBlock } from "../types/workflowRunTypes";
import { isTaskVariantBlock, WorkflowBlockTypes } from "../types/workflowTypes";
import { Switch } from "@/components/ui/switch";
type Props = {
block: WorkflowRunBlock;
@@ -27,6 +28,10 @@ function TaskBlockParameters({ block }: Props) {
const showValidationParameters =
block.block_type === WorkflowBlockTypes.Validation;
const showIncludeActionHistoryInVerification =
block.block_type === WorkflowBlockTypes.Task ||
block.block_type === WorkflowBlockTypes.Navigation;
return (
<>
<div className="flex gap-16">
@@ -44,7 +49,7 @@ function TaskBlockParameters({ block }: Props) {
<div className="w-80">
<h1 className="text-lg">Navigation Goal</h1>
<h2 className="text-base text-slate-400">
Where should Skyvern go and what should Skyvern do?
What should Skyvern do on this page?
</h2>
</div>
<AutoResizingTextarea value={block.navigation_goal ?? ""} readOnly />
@@ -129,6 +134,23 @@ function TaskBlockParameters({ block }: Props) {
/>
</div>
) : null}
{showIncludeActionHistoryInVerification ? (
<div className="flex gap-16">
<div className="w-80">
<h1 className="text-lg">Include Action History</h1>
<h2 className="text-base text-slate-400">
Whether to include action history in the completion verification
</h2>
</div>
<div className="w-full">
<Switch
checked={block.include_action_history_in_verification ?? false}
disabled
/>
</div>
</div>
) : null}
</>
);
}