fix: installCLI() writes version-stable alias that self-updates across plugin upgrades#2056
Closed
fix: installCLI() writes version-stable alias that self-updates across plugin upgrades#2056
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro 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 |
…e aliases Fixes two compound defects in installCLI(): Defect A: The alias was composed from ROOT which resolves to a version-pinned cache directory (e.g. .../cache/.../10.5.2/...). Now uses the stable marketplace path with $HOME for portability. Defect B: The includes() guard prevented repair of stale aliases. Now uses regex-based detection that can update stale/version-pinned aliases to the canonical form on every installer run. Also fixes the analogous Windows PowerShell branch and removes the now-unnecessary .cli-installed marker early-return. Agent-Logs-Url: https://github.com/thedotmack/claude-mem/sessions/e08b65f5-8940-41ad-b10c-fb568de0e873 Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>
…tion Agent-Logs-Url: https://github.com/thedotmack/claude-mem/sessions/e08b65f5-8940-41ad-b10c-fb568de0e873 Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix installCLI to allow self-updating claude-mem alias
fix: installCLI() writes version-stable alias that self-updates across plugin upgrades
Apr 17, 2026
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.
installCLI()bakes the versioned cache path (e.g..../cache/.../10.5.2/scripts/worker-service.cjs) into~/.zshrc/~/.bashrc, and theincludes('alias claude-mem=')guard prevents any subsequent run from repairing it. After any plugin upgrade,claude-memeither runs stale code or fails with ENOENT.Changes
$HOME/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs) instead ofROOT. Uses$HOMEliteral so the shell expands it at invocation time.content.includes('alias claude-mem=')with/^alias claude-mem=.*$/mregex match. Detects stale aliases and replaces them in-place; canonical aliases are a no-op; commented-out lines are ignored.function claude-membranch — stable path + regex-based update..cli-installedmarker: The per-ROOT marker file early-return is obsolete now that the guard is content-aware.Before:
After:
Tests
Added source-level pattern tests and runtime simulation tests covering: fresh install, stale alias replacement, canonical no-op, and commented-out line handling.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.sh/usr/bin/curl curl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either: