Menu

#332 fix(install): clean up legacy bundle agents + migrate .env on DMG upgrade

closed
nobody
None
2026-06-24
2026-06-24
Anonymous
No

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

Related

Tickets: #330
Tickets: #347

Discussion

  • Anonymous

    Anonymous - 2026-06-24

    Originally posted by: coderabbitai[bot]

    [!IMPORTANT]

    Review skipped

    Auto reviews are disabled on base/target branches other than the default branch.

    Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.


    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro Plus

    Run ID: cca2bca6-a952-4b27-b840-fb4426371b29

    You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

    Use the checkbox below for a quick retry:
    - [ ] 🔍 Trigger review

    ✨ Finishing Touches
    🧪 Generate unit tests (beta) - [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/dmg-upgrade-legacy-cleanup`

    Comment @coderabbitai help to get the list of available commands.

     
  • Anonymous

    Anonymous - 2026-06-24

    Ticket changed by: Akarsh-Hegde

    • status: open --> closed
     

Log in to post a comment.