Skip to content

Restore defaults for corrupt chat preferences - #469

Draft
Sheng Chen (jdneo) with Copilot wants to merge 2 commits into
jdneo-preferences-01-nonblocking-loadingfrom
copilot/jdneo-preferences-01-nonblocking-loading
Draft

Sheng Chen (jdneo) with Copilot wants to merge 2 commits into
jdneo-preferences-01-nonblocking-loadingfrom
copilot/jdneo-preferences-01-nonblocking-loading

Conversation

Copilot AI commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Retrying cannot repair a preference file with invalid content, while resetting on transient or access failures risks overwriting valid settings. This change adds explicit recovery for confirmed corruption and preserves non-destructive retry behavior for other failures.

  • Recovery flow: Show a localized Restore defaults action with a notice that saved chat settings and input history will be reset. No confirmation dialog is added.
  • Durable file replacement: Run recovery off the SWT thread; back up the exact corrupt bytes to a unique sibling file, recheck that the preference file has not changed, then atomically replace it with serialized defaults. Publish READY only after persistence succeeds.
  • Failure and lifecycle safety: Keep backup/write failures actionable without claiming success. Guard recovery by account and generation, coalesce duplicate requests, and re-evaluate changed files rather than overwriting newer choices.
  • Independent behavior: Preserve mode-discovery retry and existing model, policy, and confirmation gates. Reuse the existing error logger/telemetry pipeline.
invalid preference content → Restore defaults → backup → durable defaults → READY
transient, path, or access failure → Retry

Co-authored-by: jdneo <6193897+jdneo@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement incremental recovery functionality for preferences Restore defaults for corrupt chat preferences Sep 30, 2026
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.

2 participants