fix(desktop): allow saving personas with an empty system prompt#1276
Merged
Conversation
Core memory is now auto-injected at runtime, so a persona no longer needs to carry its own system prompt. Drop the empty-prompt guard on the Persona panel at both layers: - create_persona/update_persona stored the prompt via trim_required, which rejected an empty value with "System prompt is required". Store the trimmed value instead; empty is valid. display_name stays required. - PersonaDialog's save button used an inline systemPrompt.trim() guard. Extract a pure canSubmitPersonaDialog helper (display name required, prompt optional) and unit-test it. An empty persona prompt persists as "" and frames as a present, empty [System] section; core/base memory still appends via with_core. The Agent panel already permitted an empty override (canSubmit never gated on it), so no change was needed there. Out of scope: team-directory and persona-card import parsers still filter empty prompts; this task is the desktop panel save behavior only. Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enable saving in the Persona panel even when the System Prompt field is empty. Core memory is auto-injected at runtime now, so a persona no longer needs to carry its own prompt.
The Agent panel (System Prompt Override) already permitted empty — its
canSubmitnever gated on the prompt and the field reads "Leave blank to send no ACP system prompt" — so no change was needed there.Changes
commands/personas.rs—create_persona/update_personavalidated the prompt viatrim_required, rejecting empty with "System prompt is required". Now stores the trimmed value; empty is valid.display_namestays required.personaDialogState.ts— new purecanSubmitPersonaDialog({displayName, isPending})(display name required, prompt optional).PersonaDialog.tsx— save button uses the helper instead of an inlinesystemPrompt.trim().length === 0guard.personaDialogState.test.mjs— 3 unit tests: empty prompt OK, blank display name blocked, pending blocked.Behavior
An empty persona prompt persists as
""and frames as a present, empty[System]section; core/base memory still appends viawith_core. That's exactly the intended distinction: no persona text, but still a system-prompt payload when core/base exists.Out of scope
Team-directory and persona-card import parsers still filter empty prompts (
teams.rs,persona_card.rs). This PR is the desktop panel save behavior only.Testing
pnpm test→ 1132 pass (incl. 3 new)pnpm typecheck+biome checkcleanjust desktop-tauri-test→ 712 pass, 0 failReviewed with @max (downstream-assumption + test-surface pass).
Signed-off-by: Tyler Longwell tlongwell@block.xyz