Originally created by: Akarsh-Hegde
Summary
- Adds
cleanup_legacy_mlx_server() — stops the old bundle's com.meridiona.mlx-server launchd agent before the tray's in-process MlxManager starts, preventing EADDRINUSE port-contention on :7823.
- Adds
cleanup_legacy_ui() — removes the retired com.meridiona.ui Node-server agent (zombie process burning ~150 MB).
- Adds
migrate_legacy_bundle_env() — copies ~/.meridian/app/.env → ~/.meridian/.env when the canonical file is absent, so Jira/GitHub/Linear tokens survive the DMG upgrade without forcing wizard re-entry.
All three follow the existing cleanup_legacy_screenpipe idiom. Covered by a new unit test exercising all three branches of the env-migration logic.
Why now
Targets users migrating from the old npm/curl bundle to the self-contained DMG (v1.64.0). Without this fix they hit silent port contention + lost credentials on first launch after the upgrade. Needs to land in pre-main so it's included in the [#330] fold.
Test plan
- [ ]
cargo test -p meridian-tray — unit test backend_install::tests::migrate_legacy_bundle_env_* passes
- [ ] Manual: install old bundle, then install new DMG — verify no
EADDRINUSE in logs, ~/.meridian/.env has the migrated creds, and neither com.meridiona.mlx-server nor com.meridiona.ui are registered post-install
🤖 Generated with Claude Code
https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH
Originally posted by: coderabbitai[bot]
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/dmg-upgrade-legacy-cleanup`Comment
@coderabbitai helpto get the list of available commands.Ticket changed by: Akarsh-Hegde