Repository navigation
feat(hooks): nudge CLI upgrade when a newer stable release is cached - #8
Merged
Merged
Conversation
SessionStart now compares `composio version` against the CLI's own 24h-throttled release cache (~/.composio/update-check.json) and appends "A newer Composio CLI (X.Y.Z) is available — run `composio upgrade`." to the auth line. Local file read only — never the network (PRDE-1144; `composio version --check` from ComposioHQ/composio#3944 was ruled out for the hook because it can do a synchronous fetch on a stale cache, which could blow the 8s hook budget). Only a plain X.Y.Z install strictly older than a plain X.Y.Z latestVersion nudges; prereleases on either side, a missing or malformed cache, or an unparseable version all degrade to silence. Tests pin HOME so the cache read stays hermetic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Implements the composio-plugin-cc slice of PRDE-1144.
What
The SessionStart hook already offers to install the CLI when it is missing; now it also nudges when the installed CLI is outdated. In the CLI-present branch it compares
composio versionagainst the CLI's own 24h-throttled release cache (~/.composio/update-check.json, shape{"lastChecked", "latestVersion"}) and appends to the context line:Why the cache file and not
composio version --checkComposioHQ/composio#3944 adds
version --checkas the first-class machine-readable source, but (a) it is still unmerged/unreleased so the installed base doesn't have it, and (b) its contract does a synchronous GitHub fetch (10s timeout) when the cache is stale with no cache-only flag — which can blow the hook's 8s budget and would break the plugin's no-network-in-hooks convention. #3944's own PR body designates the unchanged cache file as what PRDE-1144 reads, so the hook reads it directly: a pure local file read on every path.Degradation matrix (all silent, hook always exits 0)
0.2.32-beta.289) — the plugin adds no beta policy of its ownlatestVersionin the cache (the anchored-quote sed rejects it rather than truncating0.3.0-beta.1to0.3.0)composio versionoutputComparison is numeric per field (
sort -t. -kN,Nn), so0.2.9 < 0.2.10is handled correctly.Verification
python3 -m pytest tests/unit -q— 49 passed (11 new nudge cases; test env now pinsHOMEso the cache read is hermetic).$HOMEwith cache0.2.32+ fake CLI0.2.30→ nudge emitted verbatim; this machine's real beta install (0.2.32-beta.289) → silent.🤖 Generated with Claude Code