Skip to content

fix(cli): report a pinned uv tool upgrade as not upgraded - #2040

Merged
phernandez merged 1 commit into
mainfrom
fix/2000-auto-update-pinned-noop
Nov 4, 2026
Merged

phernandez merged 1 commit into
mainfrom
fix/2000-auto-update-pinned-noop

Conversation

@phernandez

Copy link
Copy Markdown
Member

Part of #2000: the first request, detecting a pinned no-op upgrade.

Summary

  • Auto-update reported UPDATED whenever uv tool upgrade exited 0, and the stdio MCP startup logged that a newer version was installed. A uv tool receipt that pins basic-memory==0.24.1 keeps that version, and uv still exits 0.
  • For uv tool installs, the updater now reads the installed version through the tool's own interpreter, before and after the upgrade. uv upgrades the environment in place, so the second read sees the new distribution.
  • If the version did not change, the result is a new status, NOT_UPGRADED. Its message gives the installed and latest versions and how to reinstall. bm update and the periodic CLI check print it, and MCP startup logs it.
  • A real upgrade's message now names the new version.
  • Homebrew keeps the old behavior: each version lives in its own Cellar directory, so this process can't read the new one.

Not in this PR

The second request in #2000 is a setting to notify instead of installing a major version. It needs a decision on the default, so it stays open on the issue.

Test plan

  • An upgrade from 1.0.0 to 9.9.9 is UPDATED, says "updated to 9.9.9", and reads the version twice through the tool interpreter.
  • A pinned receipt (0.24.1 before and after) is NOT_UPGRADED, with no restart recommended.
  • An unreadable installed version fails the update with the interpreter's error.
  • tests/cli -k "update or mcp": 81 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL4TcbWdXhdvAzxfqjo

Auto-update reported UPDATED whenever `uv tool upgrade` exited 0, and
the stdio MCP startup then logged that a newer version was installed.
A uv tool receipt that pins basic-memory keeps that version and uv still
exits 0, so the message was wrong.

For uv tool installs, the updater now reads the version installed in the
tool environment, through the tool's own interpreter, before and after
the upgrade. If it did not change, the result is NOT_UPGRADED with the
installed and latest versions and how to reinstall; bm update, the
periodic CLI check and the MCP startup report it. A real upgrade's
message names the new version. Homebrew installs keep the old behavior:
each version lives in its own Cellar directory, so this process cannot
read the new one.

Part of #2000; notifying instead of installing a major version is not
in this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMYVL4TcbWdXhdvAzxfqjo
Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T00:36:52.953090Z 735f331 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Flynn-Kawolsky

Copy link
Copy Markdown

Tested #2040 on Windows 11 with a uv tool install pinned to basic-memory==0.24.1 (receipt specifier ==0.24.1, isolated tool dir). Called run_auto_update(force=True) with the tool's interpreter, emulating a running 0.24.1 process:

  • main: UPDATED ("updated successfully, restart"), but the installed version stays 0.24.1.
  • this PR: NOT_UPGRADED — "still 0.24.1 (latest: 1.0.0). The uv tool install probably pins this version…", no restart recommended.
  • control (receipt without a pin, same 0.24.1 install): UPDATED, "updated to 1.0.0", installed version 1.0.0.

I did not run the unit tests or the bm update / MCP startup paths locally. The second request in #2000 (notify instead of installing a major version) is still open.

@phernandez
phernandez merged commit 8ad9d07 into main Nov 4, 2026
50 checks passed
@phernandez
phernandez deleted the fix/2000-auto-update-pinned-noop branch November 4, 2026 06:57
phernandez added a commit that referenced this pull request Nov 12, 2026
…background (#2099)

Stack 4/4, based on #2098.

## Why
#2000's second request: the background checks (MCP startup, the periodic
CLI check) install any newer release, including a new major version. A
major release can remove tools and settings people rely on, as 1.0
removed the legacy tool names. The pinned-install half of #2000 landed
in #2040.

## What
- A background check (`force=False`) that finds a new major version
returns `UPDATE_AVAILABLE` with the release-notes link and "run `bm
update`". `bm update` passes `force` and still installs it. Minor and
patch releases install as before.
- There is no setting: background checks never install a major version.
Say if you want it configurable.
- Existing upgrade tests used `9.9.9` as the latest version, which is
now a major jump from 1.0.0. They use `1.9.9` instead.
- Note: the two new flow tests use this file's existing PyPI stub
(monkeypatch), because `run_auto_update` has no other seam.
`is_major_upgrade` is tested directly.

Closes #2000

## Verification
- `just fast-check`
- `just fast-test` on the top of the stack (`-m "not semantic and not
benchmark"`): 3993 passed, 21 skipped. Postgres runs in CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01CMYVL1rjJwNnrvxniz1dDD

---------

Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants