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

@@ -38,7 +38,7 @@ import {
CreateNewTaskFormValues,
} from "./taskFormTypes";
import { ProxySelector } from "@/components/ProxySelector";
import { Switch } from "@/components/ui/switch";
type Props = {
initialValues: CreateNewTaskFormValues;
};
@@ -80,6 +80,8 @@ function createTaskRequestObject(
extracted_information_schema: extractedInformationSchema,
totp_identifier: transform(formValues.totpIdentifier),
error_code_mapping: errorCodeMapping,
include_action_history_in_verification:
formValues.includeActionHistoryInVerification,
};
}
@@ -425,6 +427,36 @@ function CreateNewTaskForm({ initialValues }: Props) {
{isActive("advanced") && (
<div className="space-y-6">
<div className="space-y-4">
<FormField
control={form.control}
name="includeActionHistoryInVerification"
render={({ field }) => (
<FormItem>
<div className="flex gap-16">
<FormLabel>
<div className="w-72">
<h1 className="text-lg">Include Action History</h1>
<h2 className="text-base text-slate-400">
Whether to include action history when verifying
the task completion.
</h2>
</div>
</FormLabel>
<div className="w-full">
<FormControl>
<Switch
checked={field.value ?? false}
onCheckedChange={(checked) => {
field.onChange(checked);
}}
/>
</FormControl>
<FormMessage />
</div>
</div>
</FormItem>
)}
/>
<FormField
control={form.control}
name="maxStepsOverride"

View File

@@ -61,6 +61,7 @@ function CreateNewTaskFormPage() {
totpIdentifier: null,
webhookCallbackUrl: null,
proxyLocation: null,
includeActionHistoryInVerification: null,
}}
/>
</div>
@@ -127,6 +128,9 @@ function CreateNewTaskFormPage() {
maxStepsOverride,
totpIdentifier: data.workflow_definition.blocks[0].totp_identifier,
errorCodeMapping: JSON.stringify(errorCodeMapping, null, 2),
includeActionHistoryInVerification:
data.workflow_definition.blocks[0]
.include_action_history_in_verification,
}}
/>
</div>

View File

@@ -99,6 +99,8 @@ function createTaskTemplateRequestObject(values: SavedTaskFormValues) {
max_steps_per_run: values.maxStepsOverride,
totp_identifier: values.totpIdentifier,
error_code_mapping: safeParseMaybeJSONString(values.errorCodeMapping),
include_action_history_in_verification:
values.includeActionHistoryInVerification,
},
],
},

View File

@@ -42,6 +42,8 @@ function RetryTask() {
? JSON.stringify(task.request.error_code_mapping, null, 2)
: "",
proxyLocation: task.request.proxy_location ?? null,
includeActionHistoryInVerification:
task.request.include_action_history_in_verification ?? false,
}}
/>
</div>

View File

@@ -14,6 +14,7 @@ const createNewTaskFormSchemaBase = z.object({
totpIdentifier: z.string().or(z.null()),
errorCodeMapping: z.string().or(z.null()),
proxyLocation: z.nativeEnum(ProxyLocation).or(z.null()),
includeActionHistoryInVerification: z.boolean().or(z.null()).default(false),
});
const savedTaskFormSchemaBase = createNewTaskFormSchemaBase.extend({