fix(install): clean up legacy bundle agents + migrate .env on DMG upgrade#332
Merged
Merged
Conversation
…rade A user migrating from the old npm/curl bundle to the self-contained DMG carries launchd agents and a credential file the new topology no longer matches. The DMG install path only cleaned up the legacy screenpipe agent; three gaps remained: - com.meridiona.mlx-server (bundle launchd MLX on :7823) was left running, contending with the tray's in-process MlxManager on the same port → EADDRINUSE spawn-retry churn + log spam. - com.meridiona.ui (retired standalone dashboard server) lingered as a zombie Node process burning ~150 MB. - Bundle creds at ~/.meridian/app/.env were not copied to the canonical ~/.meridian/.env the DMG daemon reads → Jira/GitHub/Linear tokens silently lost, forcing a wizard re-entry. Add cleanup_legacy_mlx_server() + cleanup_legacy_ui() (mirroring the existing cleanup_legacy_screenpipe idiom) and migrate_legacy_bundle_env(), which copies the bundle .env across only when the canonical one is absent — never clobbering creds the tray already wrote. Covered by a unit test over all three branches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cleanup_legacy_mlx_server()— stops the old bundle'scom.meridiona.mlx-serverlaunchd agent before the tray's in-processMlxManagerstarts, preventingEADDRINUSEport-contention on:7823.cleanup_legacy_ui()— removes the retiredcom.meridiona.uiNode-server agent (zombie process burning ~150 MB).migrate_legacy_bundle_env()— copies~/.meridian/app/.env→~/.meridian/.envwhen 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_screenpipeidiom. 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 inpre-mainso it's included in the #330 fold.Test plan
cargo test -p meridian-tray— unit testbackend_install::tests::migrate_legacy_bundle_env_*passesEADDRINUSEin logs,~/.meridian/.envhas the migrated creds, and neithercom.meridiona.mlx-servernorcom.meridiona.uiare registered post-install🤖 Generated with Claude Code
https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH