Skip to content

fix: skip prompt commit when prompt is undefined - #185

Merged
dazzatronus merged 1 commit into
mainfrom
fix/undefined-prompt-commit
Sep 15, 2026
Merged

dazzatronus merged 1 commit into
mainfrom
fix/undefined-prompt-commit

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

Why

Clearing or emptying the generate prompt triggered a debounced updateClip with prompt: undefined, which fails Zod and crashed the host.

Verify

  • npx jest tests/generate-toolbar.test.ts
  • Vite: select an AI/prompt clip, clear or partially edit the prompt, wait for debounce — no Zod crash.

Risk

Low. Empty prompts no longer persist via updateClip (generate already no-ops on empty input). Merge-field bindings are still cleared.

Debounced generate-toolbar commits wrote `prompt: undefined` when the
field was cleared, which fails Zod validation and crashed the host.
Skip the clip update for empty prompts; still clear merge bindings.
@dazzatronus
dazzatronus merged commit 0e0e1e4 into main Sep 15, 2026
1 check passed
@dazzatronus
dazzatronus deleted the fix/undefined-prompt-commit branch September 15, 2026 12:48
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.19.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant