fix(config): restore default system prompt on upgrade for uncustomized configs#158
Merged
Merged
Conversation
…d configs Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
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.
Summary
system_customized: booltoPromptSectionto distinguish deliberate clears from old-config artifactsDEFAULT_SYSTEM_PROMPT_BASEwhensystem_customizedisfalseandsystemis empty, healing configs from before the Settings UI existed wheresystem = ""was the compiled defaultwrite_field_to_diskco-writessystem_customized = truewheneverprompt.systemis saved via Settings, so future intentional clears are respectedWhy
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. Thesystem_customizedflag is the minimal sentinel needed to tell these two cases apart without a schema version bump.Test plan
bun run test:all:coveragepasses (837 backend tests, coverage gate clean)bun run validate-buildpasses (zero warnings, zero errors)system = ""and nosystem_customizedkey: confirm default prompt is restored on next loadsystem_customized = trueis written to TOML and empty is preserved on next load