Skip to content

fix(desktop): allow saving personas with an empty system prompt#1276

Merged
tlongwell-block merged 1 commit into
mainfrom
eva/persona-empty-prompt-save
Jun 25, 2026
Merged

fix(desktop): allow saving personas with an empty system prompt#1276
tlongwell-block merged 1 commit into
mainfrom
eva/persona-empty-prompt-save

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

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 canSubmit never 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.rscreate_persona/update_persona validated the prompt via trim_required, rejecting empty with "System prompt is required". Now stores the trimmed value; empty is valid. display_name stays required.
  • personaDialogState.ts — new pure canSubmitPersonaDialog({displayName, isPending}) (display name required, prompt optional).
  • PersonaDialog.tsx — save button uses the helper instead of an inline systemPrompt.trim().length === 0 guard.
  • 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 via with_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 check clean
  • just desktop-tauri-test → 712 pass, 0 fail
  • pre-push hooks (desktop-test, desktop-tauri-test, rust-tests, mobile-test) green

Reviewed with @max (downstream-assumption + test-surface pass).

Signed-off-by: Tyler Longwell tlongwell@block.xyz

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>
@tlongwell-block tlongwell-block merged commit 996a3f8 into main Jun 25, 2026
45 of 47 checks passed
@tlongwell-block tlongwell-block deleted the eva/persona-empty-prompt-save branch June 25, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant