Skip to content

fix(config): restore default system prompt on upgrade for uncustomized configs#158

Merged
quiet-node merged 1 commit into
mainfrom
worktree-abstract-fluttering-flute
May 11, 2026
Merged

fix(config): restore default system prompt on upgrade for uncustomized configs#158
quiet-node merged 1 commit into
mainfrom
worktree-abstract-fluttering-flute

Conversation

@quiet-node
Copy link
Copy Markdown
Owner

Summary

  • Adds system_customized: bool to PromptSection to distinguish deliberate clears from old-config artifacts
  • Loader now restores DEFAULT_SYSTEM_PROMPT_BASE when system_customized is false and system is empty, healing configs from before the Settings UI existed where system = "" was the compiled default
  • write_field_to_disk co-writes system_customized = true whenever prompt.system is saved via Settings, so future intentional clears are respected

Why

Old configs (pre-Settings UI) were seeded with system = "" as the compiled default. After the Settings UI shipped, loading those configs sent no persona at all instead of the built-in secretary prompt. The system_customized flag is the minimal sentinel needed to tell these two cases apart without a schema version bump.

Test plan

  • bun run test:all:coverage passes (837 backend tests, coverage gate clean)
  • bun run validate-build passes (zero warnings, zero errors)
  • Manually upgrade a config with system = "" and no system_customized key: confirm default prompt is restored on next load
  • Save a blank system prompt via Settings: confirm system_customized = true is written to TOML and empty is preserved on next load

…d configs

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
@quiet-node quiet-node merged commit 43e0386 into main May 11, 2026
3 checks passed
@quiet-node quiet-node deleted the worktree-abstract-fluttering-flute branch May 11, 2026 22:42
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