Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(prompts): commitMessage error handling in NewPromptForm (#7984)

marliessophie0a976edb7072
diff --git a/web/src/features/prompts/components/NewPromptForm/index.tsx b/web/src/features/prompts/components/NewPromptForm/index.tsx
index ca2c107ee2..8d256b1560 100644
--- a/web/src/features/prompts/components/NewPromptForm/index.tsx
+++ b/web/src/features/prompts/components/NewPromptForm/index.tsx
@@ -90,7 +90,7 @@ export const NewPromptForm: React.FC<NewPromptFormProps> = (props) => {
name: initialPrompt?.name ?? (folderPath ? `${folderPath}/` : ""),
config: JSON.stringify(initialPrompt?.config?.valueOf(), null, 2) || "{}",
isActive: !Boolean(initialPrompt),
- commitMessage: initialPrompt?.commitMessage ?? undefined,
+ commitMessage: undefined,
};
const form = useForm({
diff --git a/web/src/features/prompts/components/NewPromptForm/validation.ts b/web/src/features/prompts/components/NewPromptForm/validation.ts
index 7943aa1ea4..cd55022742 100644
--- a/web/src/features/prompts/components/NewPromptForm/validation.ts
+++ b/web/src/features/prompts/components/NewPromptForm/validation.ts
@@ -18,8 +18,8 @@ const NewPromptBaseSchema = z.object({
commitMessage: z
.string()
.trim()
- .min(1)
.max(COMMIT_MESSAGE_MAX_LENGTH)
+ .transform((val) => (val === "" ? undefined : val))
.optional(),
});