Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jan 24, 2026

Summary

This PR introduces two improvements to configuration handling:

  1. Auto-migration of old v1 default condensing prompt - Detects and clears the old v1 default condensing prompt from customSupportPrompts.CONDENSE using fingerprinting, allowing users to automatically receive the improved v2 default (which includes analysis tags, error tracking, and better task continuity).

  2. Lenient settings import with invalid provider handling - The settings import system now gracefully handles invalid or removed API providers instead of failing the entire import.

Changes

  • Add migrateOldDefaultCondensingPrompt() migration that runs on ContextProxy initialization
  • Add isOldV1DefaultCondensePrompt() fingerprinting function to detect v1 default without exact matching
  • Implement sanitizeProviderConfig() to strip invalid/removed apiProvider values from imported profiles
  • Validate each provider profile individually using providerSettingsWithIdSchema.safeParse()
  • Collect and return warnings for profiles that had issues (invalid providers or schema errors)
  • Show showWarningMessage notification when import succeeds with warnings
  • Fail gracefully only when ALL profiles are invalid, with detailed error messages
  • Add default URI to import file picker (uses last export path or falls back to Downloads folder)
  • Add comprehensive tests for both migrations and all import edge cases

Important

This PR auto-migrates old v1 condensing prompts and handles invalid providers during import, enhancing configuration handling and user experience.

  • Behavior:
    • Auto-migrates old v1 default condensing prompt in ContextProxy.ts using migrateOldDefaultCondensingPrompt().
    • Handles invalid/removed API providers in importExport.ts using sanitizeProviderConfig().
    • Imports settings with warnings for invalid profiles, only failing if all profiles are invalid.
  • Functions:
    • Adds isOldV1DefaultCondensePrompt() in ContextProxy.ts for prompt detection.
    • Adds importSettingsFromPath() in importExport.ts for lenient import handling.
  • Tests:
    • Adds tests for prompt migration and provider handling in ContextProxy.spec.ts.
    • Adds tests for import scenarios in importExport.spec.ts.

This description was created by Ellipsis for cf9f809. You can customize this summary. It will automatically update as commits are pushed.

…n import

- Add migration to detect and clear old v1 default condensing prompt from
  customSupportPrompts.CONDENSE using fingerprinting, allowing users to
  automatically receive the improved v2 default
- Implement lenient settings import that sanitizes invalid/removed apiProvider
  values instead of failing the entire import
- Validate each provider profile individually, collecting warnings for issues
  while preserving valid profiles
- Show warning notifications when import succeeds with issues
- Add default URI to import file picker (last export path or Downloads folder)
- Add comprehensive tests for both migrations and import edge cases
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. bug Something isn't working labels Jan 24, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 24, 2026

Oroocle Clock   Follow along on Roo Cloud

Review status: The remaining edge cases are addressed; no further changes requested.

  • Ensure currentApiConfigName is only set to an imported profile that actually survived per-profile validation (fallback if the imported current profile was skipped).
  • Avoid dumping all import warnings into a single VS Code toast; prefer a short summary and log full details elsewhere (or truncate).
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

- Add currentApiConfigName fallback when imported current profile was skipped
  - If the imported currentApiConfigName profile is invalid/skipped, fall back to
    the first valid imported profile
  - Add warning message when fallback occurs
- Improve warning notification UX for settings import
  - Show short summary in toast (e.g., '2 profiles had issues during import.')
  - Log full warning details to Developer Tools console
  - Reference console in the toast message for users who need full details
- Add comprehensive tests for the new fallback and notification behavior
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 24, 2026
@mrubens mrubens merged commit b042866 into main Jan 24, 2026
15 of 17 checks passed
@mrubens mrubens deleted the fix/settings-migration-and-import-robustness branch January 24, 2026 03:32
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 24, 2026
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants