Skip to content

fix(migration): preserve legacy data and clarify import results - #2949

Merged
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:fix-migrator
Sep 10, 2026
Merged

wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:fix-migrator

Conversation

@wsp1911

@wsp1911 wsp1911 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restore session migration when assistant workspaces contain deeply nested project or build directories.
  • Copy workspace and assistant directories without arbitrary depth, file-count, or size limits, while retaining source isolation and safe publication.
  • Normalize retired configuration values in the legacy importer and recover invalid current configuration without blocking application startup.
  • Report sessions, workspaces, and assistant directories separately, excluding routine auxiliary paths from skipped counts.

Type and Areas

Type: Bug fix, UI/UX

Areas: Data Migrator, legacy migration adapters, Rust configuration contracts/core, documentation, localization

Motivation / Impact

Deeply nested assistant workspace content could cause session migration to be skipped entirely. Legacy settings such as ai.agent_model_defaults.mode: auto could also migrate successfully but prevent the main application from starting.

The importer now converts retired settings to supported values and reconciles configuration after merging. Application startup can recover invalid values and references while retaining unusable model records disabled with diagnostics, without rewriting the original configuration file on load.

Migration totals now reflect distinct data types. For example, a result previously shown as 175 imported and 173 skipped becomes 143 sessions, 30 workspaces, and 2 assistant directories, without presenting routine auxiliary exclusions as skipped user data.

Verification

Recorded during implementation:

  • cargo test -p openbitfun-config-contracts --lib — 86 passed.
  • cargo test -p openbitfun-legacy-migration-adapters --lib — 51 passed.
  • cargo test -p openbitfun-core --no-default-features --lib service::config:: — 57 passed.
  • cargo test -p openbitfun-legacy-migration --lib directory::tests — 2 passed, including copying 32,769 files across 24 directory levels and rejecting overlapping paths.
  • cargo test -p openbitfun-data-migrator --lib — 7 passed.
  • node --test scripts/data-migrator-report.test.mjs — 3 passed.
  • node --check src/apps/data-migrator/ui/app.js — passed.
  • pnpm run fmt:rs — passed.
  • pnpm run check:core-boundaries — passed.

Verified while preparing this PR description:

  • git diff HEAD~2 HEAD --check — passed.

Not exercised: UI interaction, packaged application startup, live AI provider integration, or real remote-workspace, remote-control, peer-device, and detached-dispatch scenarios. SSH mirror coverage uses local fixtures.

Reviewer Notes

  • Legacy aliases such as auto are normalized only in the migration adapter. Shared configuration and application startup code provide generic validation and recovery rather than legacy alias support.
  • Directory copying retains link/reparse-point rejection and atomic publication/recovery behavior.
  • Older migration reports derive category totals from saved manifests; unavailable breakdowns are identified explicitly.
  • Actual warnings remain visible, and staged or failed items are not reported as imported.
  • English, Simplified Chinese, and Traditional Chinese report labels and related documentation are updated.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

- Limit session discovery to runtime storage paths so deep workspace
  content cannot cause all sessions to be skipped.
- Use generic directory copying without workspace depth or entry
  limits; retain hash verification and source isolation.
- Normalize the retired auto selector only in the legacy importer.
- Share model validation and reference recovery between migration
  and startup, reporting repairs after target conflicts are resolved.
- Preserve unusable models and credentials while disabling them,
  allowing startup without rewriting the original config file.
- Treat identical device identities as duplicates without warnings.
- Add regression coverage for deep and large trees, config recovery,
  source preservation, and device identity deduplication.
- Show sessions, workspaces, and assistant directories separately.
- Exclude routine auxiliary paths from displayed skip counts.
- Derive historical counts from saved manifests without rerunning
  migration, and explicitly report unavailable breakdowns.
- Preserve actual warnings and distinguish staged from imported data.
- Add localized labels and regression coverage.
@wsp1911
wsp1911 merged commit ea2fd08 into GCWing:main Sep 10, 2026
13 checks passed
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