fix(claude-code): numeric-aware plugin-cache version selection (fixes #95) - #101
Open
Srinivasan8888 wants to merge 1 commit into
Open
Srinivasan8888 wants to merge 1 commit into
Srinivasan8888 wants to merge 1 commit into
Conversation
…exically
_latest_cache_dir() and doctor()'s cache-staleness check used a plain
lexicographic sorted(), so '0.9.0' sorts after '0.10.0' and the wrong
cache dir is chosen once a two-digit minor/patch exists. That stages the
native evo-hook-drain binary into the wrong version dir (breaking hooks
under ${CLAUDE_PLUGIN_ROOT}) and makes doctor report a false
'cache stale' (rc=1), which also makes 'evo update' skip the host.
Add a numeric-aware _ver_key (mirroring the codex adapter, which already
does this) and use it at both sort sites.
Fixes evo-hq#95.
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.
Problem
The Claude Code adapter selects the "latest" plugin-cache version with a plain lexicographic
sorted():_latest_cache_dir()—plugins/evo/src/evo/host_install/claude_code.pydoctor()cache-staleness check — same file'0.9.0' > '0.10.0'lexically (because'9' > '1'), soversions[-1]returns0.9.0when0.10.0/0.11.0also exist.Impact:
_stage_hook_drainstages the nativeevo-hook-drainbinary into the0.9.0/bin/dir, but Claude Code resolves${CLAUDE_PLUGIN_ROOT}to0.10.0, whosebin/lacks it → hooks that need the binary break (evo directdelivery).doctor()prints✗ cache stale: installed=0.9.0, marketplace=0.10.0(rc=1) even though0.10.0is installed — a false failure that also makesevo updateskip the host.The sibling
codex.pyadapter already solves this with a numeric-aware_ver_key; this ports the same fix.Fix
Add a numeric-aware
_ver_keyand use it at both sort sites.Tests
tests/unit/test_claude_cache_version.py(TDD, failing first):_latest_cache_dirpicks0.11.0over0.9.0, and0.8.10over0.8.9; returnsNoneon an empty cache. Existingtest_claude_code_install_paths.pystill passes.Fixes #95.