From 9dab6d687891b402eb19b62993efb1a8752d53b3 Mon Sep 17 00:00:00 2001 From: phernandez Date: Sun, 29 Nov 2026 12:28:31 -0600 Subject: [PATCH 1/2] fix(cli): announce minor releases instead of auto-installing them 1.1 splits bm_project and bm_schema into new tools, so a background install from 1.0 would break client tool allowlists and hooks without warning. Background checks now treat a minor bump like a major one: report it with release notes and leave the install to `bm update`. Patch releases still install automatically. Refs #2164 Co-Authored-By: Claude Opus 5.5 Signed-off-by: phernandez --- src/basic_memory/cli/auto_update.py | 22 ++++++---- tests/cli/test_auto_update.py | 62 +++++++++++++++++++---------- tests/cli/test_mcp_command.py | 2 +- 3 files changed, 55 insertions(+), 31 deletions(-) diff --git a/src/basic_memory/cli/auto_update.py b/src/basic_memory/cli/auto_update.py index 089556f8a..3a034f2e1 100644 --- a/src/basic_memory/cli/auto_update.py +++ b/src/basic_memory/cli/auto_update.py @@ -223,9 +223,13 @@ def _check_pypi_update_available() -> tuple[bool, str]: return latest_version > current_version, latest -def is_major_upgrade(current: str, latest: str) -> bool: - """Whether moving from ``current`` to ``latest`` crosses a major version.""" - return Version(latest).major > Version(current).major +def is_feature_upgrade(current: str, latest: str) -> bool: + """Whether moving from ``current`` to ``latest`` crosses a minor or major version.""" + current_version, latest_version = Version(current), Version(latest) + return (latest_version.major, latest_version.minor) > ( + current_version.major, + current_version.minor, + ) def release_notes_url(version: str) -> str: @@ -413,14 +417,16 @@ def run_auto_update( ) # Trigger: a background check (MCP startup, the periodic CLI check) found a - # release with a new major version. `bm update` passes force and installs it. - # Why: a major release can remove tools and settings the user relies on (1.0 - # removed the legacy tool names), so it should not land unannounced (#2000). + # release with a new minor or major version. `bm update` passes force and + # installs it. Patch releases still install automatically. + # Why: a minor or major release can remove or rename tools and settings the user + # relies on (1.0 removed the legacy tool names; 1.1 split bm_project and + # bm_schema), so it should not land unannounced (#2000, #2164). # Outcome: report the release and its notes; the user installs it on purpose. if ( not force and latest_version is not None - and is_major_upgrade(basic_memory.__version__, latest_version) + and is_feature_upgrade(basic_memory.__version__, latest_version) ): return AutoUpdateResult( status=AutoUpdateStatus.UPDATE_AVAILABLE, @@ -430,7 +436,7 @@ def run_auto_update( updated=False, latest_version=latest_version, message=( - f"Basic Memory {latest_version} is a new major version, so it was not " + f"Basic Memory {latest_version} is a new minor or major version, so it was not " f"installed automatically. Read what changed: " f"{release_notes_url(latest_version)} Then run `bm update` to install it." ), diff --git a/tests/cli/test_auto_update.py b/tests/cli/test_auto_update.py index cf0b8f887..c82a28112 100644 --- a/tests/cli/test_auto_update.py +++ b/tests/cli/test_auto_update.py @@ -24,7 +24,7 @@ _preload_lazy_console_modules, print_update_status, detect_install_source, - is_major_upgrade, + is_feature_upgrade, maybe_run_periodic_auto_update, release_notes_url, run_auto_update, @@ -93,7 +93,7 @@ def _result( checked=True, update_available=status in {AutoUpdateStatus.UPDATE_AVAILABLE, AutoUpdateStatus.UPDATED}, updated=status == AutoUpdateStatus.UPDATED, - latest_version="1.9.9", + latest_version="1.0.9", message=message, error=error, restart_recommended=status == AutoUpdateStatus.UPDATED, @@ -277,7 +277,7 @@ def _fake_run(command, **kwargs): monkeypatch.setattr("basic_memory.cli.auto_update._run_subprocess", _fake_run) monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) result = run_auto_update( @@ -287,7 +287,7 @@ def _fake_run(command, **kwargs): ) assert result.status == AutoUpdateStatus.UPDATE_AVAILABLE - assert result.latest_version == "1.9.9" + assert result.latest_version == "1.0.9" assert "brew upgrade basic-memory" in (result.message or "") @@ -310,7 +310,7 @@ def _fake_run(command, **kwargs): monkeypatch.setattr("basic_memory.cli.auto_update._run_subprocess", _fake_run) monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) result = run_auto_update( @@ -320,7 +320,7 @@ def _fake_run(command, **kwargs): assert result.status == AutoUpdateStatus.UPDATE_AVAILABLE assert result.updated is False - assert result.latest_version == "1.9.9" + assert result.latest_version == "1.0.9" assert ["brew", "upgrade", "basic-memory"] not in calls assert "untrusted tap" in (result.message or "") assert "brew upgrade basic-memory" in (result.message or "") @@ -527,9 +527,9 @@ def test_uv_tool_pypi_check_triggers_upgrade(monkeypatch, tmp_path): monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) - calls = _fake_uv_tool(monkeypatch, installed=["1.0.0", "1.9.9"]) + calls = _fake_uv_tool(monkeypatch, installed=["1.0.0", "1.0.9"]) result = run_auto_update( config_manager=_config_manager(manager), @@ -537,9 +537,9 @@ def test_uv_tool_pypi_check_triggers_upgrade(monkeypatch, tmp_path): ) assert result.status == AutoUpdateStatus.UPDATED - assert result.latest_version == "1.9.9" + assert result.latest_version == "1.0.9" assert result.restart_recommended is True - assert "updated to 1.9.9" in (result.message or "") + assert "updated to 1.0.9" in (result.message or "") upgrade = ["uv", "tool", "upgrade", "basic-memory", "--prerelease=allow"] assert [command for command in calls if command[0] == "uv"] == [upgrade] # The tool's own interpreter reports the version before and after the upgrade. @@ -567,7 +567,7 @@ def test_unreadable_uv_tool_version_fails_the_update(monkeypatch, tmp_path): manager = StubConfigManager(_base_config(tmp_path)) monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) def _broken_interpreter(command, **kwargs): @@ -586,7 +586,7 @@ def test_unknown_manager_returns_manual_update_guidance(monkeypatch, tmp_path): manager = StubConfigManager(config) monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) result = run_auto_update( @@ -620,11 +620,11 @@ def test_mcp_silent_mode_suppresses_subprocess_output(monkeypatch, tmp_path): manager = StubConfigManager(config) monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) upgrade_kwargs: list[dict[str, Any]] = [] - versions = iter(["1.0.0", "1.9.9"]) + versions = iter(["1.0.0", "1.0.9"]) def _fake_run_subprocess(command, **kwargs): if command[0] == "uv": @@ -651,7 +651,7 @@ def test_subprocess_oserror_is_non_fatal(monkeypatch, tmp_path): manager = StubConfigManager(config) monkeypatch.setattr( "basic_memory.cli.auto_update._check_pypi_update_available", - lambda: (True, "1.9.9"), + lambda: (True, "1.0.9"), ) def _raise_oserror(command, **kwargs): @@ -720,7 +720,7 @@ def test_maybe_run_periodic_auto_update_prints_available(monkeypatch): "basic_memory.cli.auto_update.run_auto_update", lambda **kwargs: _result( AutoUpdateStatus.UPDATE_AVAILABLE, - message="Update available (latest: 1.9.9).", + message="Update available (latest: 1.0.9).", ), ) @@ -778,14 +778,32 @@ def isatty(self) -> bool: assert _is_interactive_session() is False -# --- Major versions are announced, not installed in the background (#2000) --- +# --- Minor and major versions are announced, not installed in the background (#2000, #2164) --- -def test_is_major_upgrade(): - assert is_major_upgrade("1.0.0", "2.0.0") - assert is_major_upgrade("0.24.1", "1.0.0") - assert not is_major_upgrade("1.0.0", "1.9.9") - assert not is_major_upgrade("1.2.0b1", "1.2.0") +def test_is_feature_upgrade(): + assert is_feature_upgrade("1.0.0", "2.0.0") + assert is_feature_upgrade("0.24.1", "1.0.0") + assert is_feature_upgrade("1.0.0", "1.1.0") + assert is_feature_upgrade("1.0.3", "1.9.9") + assert not is_feature_upgrade("1.0.0", "1.0.1") + assert not is_feature_upgrade("1.2.0b1", "1.2.0") + + +def test_background_check_reports_a_minor_release_without_installing(monkeypatch, tmp_path): + manager = StubConfigManager(_base_config(tmp_path)) + monkeypatch.setattr("basic_memory.__version__", "1.0.0") + monkeypatch.setattr( + "basic_memory.cli.auto_update._check_pypi_update_available", + lambda: (True, "1.1.0"), + ) + calls = _fake_uv_tool(monkeypatch, installed=["1.0.0", "1.1.0"]) + + result = run_auto_update(config_manager=_config_manager(manager), executable=UV_TOOL_PYTHON) + + assert result.status == AutoUpdateStatus.UPDATE_AVAILABLE + assert calls == [] + assert release_notes_url("1.1.0") in (result.message or "") def test_background_check_reports_a_major_release_without_installing(monkeypatch, tmp_path): diff --git a/tests/cli/test_mcp_command.py b/tests/cli/test_mcp_command.py index dcd9b2110..df55a88c8 100644 --- a/tests/cli/test_mcp_command.py +++ b/tests/cli/test_mcp_command.py @@ -160,7 +160,7 @@ def _logged_messages(result: AutoUpdateResult) -> list[str]: def test_background_update_logs_a_major_release_announcement(): - announcement = "Basic Memory 2.0.0 is a new major version, so it was not installed." + announcement = "Basic Memory 2.0.0 is a new minor or major version, so it was not installed." result = AutoUpdateResult( status=AutoUpdateStatus.UPDATE_AVAILABLE, source=InstallSource.UV_TOOL, From d8cad32ef5a8f91e31738073afe39909211b147e Mon Sep 17 00:00:00 2001 From: phernandez Date: Sun, 29 Nov 2026 13:01:16 -0600 Subject: [PATCH 2/2] fix(cli): stop installing and upgrading with --prerelease=allow No dependency needs pre-releases anymore (1.0 pinned a stable FastMCP), and allowing all of them pulls unrelated alphas and release candidates into the tool environment (protobuf, redis, sqlite-vec, wrapt). uv saves --prerelease=allow in the tool receipt and reuses it on a plain `uv tool upgrade`, so auto-update and its hints pass --prerelease=if-necessary-or-explicit, which replaces the saved setting. Fresh installs (docs, README, server.json, the Claude Code/Codex plugins, the Hermes and OpenClaw installers, the hook launcher) drop the flag. Fixes #2164 Co-Authored-By: Claude Opus 5.5 Signed-off-by: phernandez --- .claude/commands/release/beta.md | 2 +- .claude/commands/release/changelog.md | 2 +- .claude/commands/release/release.md | 6 +++--- AGENTS.md | 2 +- README.md | 21 +++++++------------ SECURITY.md | 2 +- docs/litellm-provider.md | 8 +++---- integrations/hermes/README.md | 2 +- integrations/hermes/__init__.py | 17 ++++++--------- integrations/hermes/tests/test_provider.py | 2 +- integrations/openclaw/README.md | 2 +- integrations/openclaw/SECURITY.md | 5 ++--- integrations/openclaw/index.ts | 4 +--- integrations/openclaw/scripts/setup-bm.sh | 5 +---- llms-install.md | 7 ++----- plugins/claude-code/docs/getting-started.md | 4 +--- plugins/claude-code/skills/bm-setup/SKILL.md | 14 ++++++------- plugins/claude-code/skills/bm-status/SKILL.md | 2 +- plugins/codex/.mcp.json | 1 - plugins/codex/skills/bm-setup/SKILL.md | 4 ++-- plugins/codex/skills/bm-status/SKILL.md | 2 +- server.json | 6 ------ src/basic_memory/cli/auto_update.py | 18 ++++++++++------ src/basic_memory/cli/commands/hook.py | 7 ++----- src/basic_memory/cli/commands/install.py | 1 - .../repository/litellm_provider.py | 4 ++-- tests/cli/test_auto_update.py | 2 +- tests/cli/test_hook_command.py | 6 +++--- tests/cli/test_update_command.py | 2 +- tests/repository/test_optional_litellm.py | 5 +---- 30 files changed, 67 insertions(+), 98 deletions(-) diff --git a/.claude/commands/release/beta.md b/.claude/commands/release/beta.md index e67bf32bc..83a726d92 100644 --- a/.claude/commands/release/beta.md +++ b/.claude/commands/release/beta.md @@ -17,7 +17,7 @@ You are an expert release manager for the Basic Memory project. When the user ru ### Step 0: Pre-release dependency check While `pyproject.toml` pins a FastMCP pre-release (`fastmcp==X.Y.Zb1`), `just beta` refuses to -run: every documented install passes `--prerelease=allow`, which uv applies to basic-memory +run: installs would then need `--prerelease=allow`, which uv applies to basic-memory itself, so a beta on PyPI would become the default install for stable users (#1338). Only publish a beta in that state deliberately, with `BASIC_MEMORY_ALLOW_BETA_WITH_PRERELEASE_DEPS=1 just beta `. diff --git a/.claude/commands/release/changelog.md b/.claude/commands/release/changelog.md index 4c6f7f7e9..2942de4b4 100644 --- a/.claude/commands/release/changelog.md +++ b/.claude/commands/release/changelog.md @@ -142,7 +142,7 @@ Example: ### Installation ```bash -uv tool install basic-memory --prerelease=allow +uv tool install basic-memory ``` ### Known Issues diff --git a/.claude/commands/release/release.md b/.claude/commands/release/release.md index d39115cff..b93f40334 100644 --- a/.claude/commands/release/release.md +++ b/.claude/commands/release/release.md @@ -78,7 +78,7 @@ The GitHub Actions workflow (`.github/workflows/release.yml`) then: #### PyPI Publication 1. Verify package published at: https://pypi.org/project/basic-memory// -2. Test installation: `uv tool install basic-memory --prerelease=allow` +2. Test installation: `uv tool install basic-memory` 3. Verify installed version: `basic-memory --version` #### Homebrew Formula (Stable Releases Only) @@ -182,13 +182,13 @@ Before starting, verify: 🚀 GitHub Actions: Completed Install with pip/uv: - uv tool install basic-memory --prerelease=allow + uv tool install basic-memory Install with Homebrew: brew install basicmachines-co/basic-memory/basic-memory Users can now upgrade: - uv tool upgrade basic-memory --prerelease=allow + uv tool upgrade basic-memory brew upgrade basic-memory ``` diff --git a/AGENTS.md b/AGENTS.md index b82fb9316..dd9c3a3f8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -377,7 +377,7 @@ The recipe runs `just lint` + `just typecheck`, then updates every release manif **Release dry run:** `just release-dry-run v0.21.4` previews the consolidated version update without writing files. -**Development builds are not published to PyPI.** Documented installs pass `--prerelease=allow` (published releases through v0.23.2 pin a FastMCP pre-release), and uv applies that flag to basic-memory itself, so a `.devN` build on PyPI would outrank the stable release for every fresh install. To try unreleased `main`, install from git: `uv tool install "basic-memory @ git+https://github.com/basicmachines-co/basic-memory" --prerelease=allow`. Keep any old `.dev` versions on PyPI yanked. +**Development builds are not published to PyPI.** Installs made with `--prerelease=allow` (documented through 1.0, and saved in older uv tool receipts) apply that flag to basic-memory itself, so a `.devN` build on PyPI would outrank the stable release for those installs. To try unreleased `main`, install from git: `uv tool install "basic-memory @ git+https://github.com/basicmachines-co/basic-memory"`. Keep any old `.dev` versions on PyPI yanked. **Do not tag releases by hand.** A bare `git tag vX.Y.Z` skips the in-code version bump. Package metadata is still correct (uv-dynamic-versioning derives it from the git tag) but `basic-memory --version` reports the previous release, which is what happened with v0.21.2 → v0.21.3. diff --git a/README.md b/README.md index e4966701a..cc11b6812 100644 --- a/README.md +++ b/README.md @@ -81,19 +81,14 @@ Pick the path that fits you. Both run the same product on the same Markdown. - Requires Python via [`uv`](https://docs.astral.sh/uv/) ```bash -uv tool install basic-memory --prerelease=allow +uv tool install basic-memory ``` -`--prerelease=allow` is required: Basic Memory 0.23 depends on a FastMCP 4 -pre-release, and `uv` only accepts pre-releases of transitive dependencies when -told to — without the flag it silently installs an older release. The same flag -goes on every `uvx` / `uv tool upgrade` command below. - For Postgres deployments that store semantic vectors in Milvus, install the first-party optional extra instead: ```bash -uv tool install "basic-memory[milvus]" --prerelease=allow +uv tool install "basic-memory[milvus]" ``` [**Configure your client ↓**](#connect-your-ai-client) @@ -286,7 +281,7 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`: "mcpServers": { "basic-memory": { "command": "uvx", - "args": ["--prerelease=allow", "basic-memory", "mcp"] + "args": ["basic-memory", "mcp"] } } } @@ -300,7 +295,7 @@ Restart Claude Desktop. Notes live in `~/basic-memory` by default. ### Claude Code ```bash -claude mcp add basic-memory -- uvx --prerelease=allow basic-memory mcp +claude mcp add basic-memory -- uvx basic-memory mcp ``` For the full memory bridge — session briefings, pre-compaction checkpoints, and @@ -314,7 +309,7 @@ Add to `~/.codex/config.toml`: ```toml [mcp_servers.basic-memory] command = "uvx" -args = ["--prerelease=allow", "basic-memory", "mcp"] +args = ["basic-memory", "mcp"] ``` Codex can keep its default MCP approval behavior, or you can pre-approve eligible @@ -323,7 +318,7 @@ Basic Memory tools by adding this server-scoped setting to the same table: ```toml [mcp_servers.basic-memory] command = "uvx" -args = ["--prerelease=allow", "basic-memory", "mcp"] +args = ["basic-memory", "mcp"] default_tools_approval_mode = "approve" ``` @@ -342,7 +337,7 @@ Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global): "mcpServers": { "basic-memory": { "command": "uvx", - "args": ["--prerelease=allow", "basic-memory", "mcp"] + "args": ["basic-memory", "mcp"] } } } @@ -358,7 +353,7 @@ Add to your User Settings (JSON): "servers": { "basic-memory": { "command": "uvx", - "args": ["--prerelease=allow", "basic-memory", "mcp"] + "args": ["basic-memory", "mcp"] } } } diff --git a/SECURITY.md b/SECURITY.md index 662e798b4..1767dc844 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -46,7 +46,7 @@ explicit arguments: "mcpServers": { "basic-memory": { "command": "uvx", - "args": ["--prerelease=allow", "basic-memory", "mcp"] + "args": ["basic-memory", "mcp"] } } } diff --git a/docs/litellm-provider.md b/docs/litellm-provider.md index a7c53f2ba..ba50b313f 100644 --- a/docs/litellm-provider.md +++ b/docs/litellm-provider.md @@ -23,7 +23,7 @@ the direct OpenAI embedding provider work without it. To opt into LiteLLM embeddings or reranking, install the extra in the environment running Basic Memory: ```bash -uv tool install --force "basic-memory[litellm]" --prerelease=allow --python 3.14 +uv tool install --force "basic-memory[litellm]" --python 3.14 # Or, in a pip-managed environment: pip install "basic-memory[litellm]" ``` @@ -33,7 +33,7 @@ does not yet provide Python 3.15 wheels. When reinstalling with uv, include every extra you still use in the same specification. For example, users who also use Milvus need -`uv tool install --force "basic-memory[litellm,milvus]" --prerelease=allow --python 3.14`. +`uv tool install --force "basic-memory[litellm,milvus]" --python 3.14`. When upgrading an existing LiteLLM configuration, keep requesting this extra. Selecting `litellm` in config does not install packages automatically; without @@ -47,7 +47,7 @@ pip or `uv tool install` does not modify that environment. Use an isolated uv process when opting into LiteLLM, rather than changing Homebrew-managed files: ```bash -uvx --python 3.14 --prerelease=allow --from "basic-memory[litellm]" bm --help +uvx --python 3.14 --from "basic-memory[litellm]" bm --help ``` Pass the desired `bm` subcommand after `bm`. For an MCP client, use this launch @@ -56,7 +56,7 @@ configuration so it starts the process that has the SDK: ```json { "command": "uvx", - "args": ["--python", "3.14", "--prerelease=allow", "--from", "basic-memory[litellm]", "bm", "mcp"] + "args": ["--python", "3.14", "--from", "basic-memory[litellm]", "bm", "mcp"] } ``` diff --git a/integrations/hermes/README.md b/integrations/hermes/README.md index 633ec0e93..64c8f8b49 100644 --- a/integrations/hermes/README.md +++ b/integrations/hermes/README.md @@ -28,7 +28,7 @@ memory: If you run the gateway, restart it (`hermes gateway restart`). Done. -The plugin self-installs the `basic-memory` CLI on first init via `uv tool install basic-memory --prerelease=allow` (one-time ~10s pause if it isn't already present). The bm binary lands at `~/.local/bin/bm` — the same location a manual `uv tool install basic-memory` would produce, so a later manual install or upgrade is a no-op rather than a second install. +The plugin self-installs the `basic-memory` CLI on first init via `uv tool install basic-memory` (one-time ~10s pause if it isn't already present). The bm binary lands at `~/.local/bin/bm` — the same location a manual `uv tool install basic-memory` would produce, so a later manual install or upgrade is a no-op rather than a second install. ### Prerequisites diff --git a/integrations/hermes/__init__.py b/integrations/hermes/__init__.py index b5c57263c..c2ef018a3 100644 --- a/integrations/hermes/__init__.py +++ b/integrations/hermes/__init__.py @@ -464,7 +464,7 @@ def _install_bm_via_uv(timeout: float = 180.0) -> str | None: Bootstrap-install basic-memory via `uv tool install`. Idempotent — re-runs are no-ops when the tool is already installed, so this - converges with later manual `uv tool install basic-memory --prerelease=allow` + converges with later manual `uv tool install basic-memory` calls and avoids the two-installations-sharing-one-config-dir foot-gun. @@ -476,24 +476,20 @@ def _install_bm_via_uv(timeout: float = 180.0) -> str | None: return None try: result = subprocess.run( - # basic-memory pins a FastMCP pre-release; without this flag uv - # silently installs the last release that had none (#1338). - [uv, "tool", "install", "basic-memory", "--prerelease=allow", "--quiet"], + [uv, "tool", "install", "basic-memory", "--quiet"], check=False, capture_output=True, timeout=timeout, env=_clean_child_env(), ) except Exception as e: - logger.warning( - "basic-memory: `uv tool install basic-memory --prerelease=allow` failed: %s", e - ) + logger.warning("basic-memory: `uv tool install basic-memory` failed: %s", e) return None if result.returncode != 0: # uv prints to stderr; capture the tail so the operator can debug. stderr_tail = (result.stderr or b"").decode("utf-8", errors="replace")[-400:] logger.warning( - "basic-memory: `uv tool install basic-memory --prerelease=allow` exited %s: %s", + "basic-memory: `uv tool install basic-memory` exited %s: %s", result.returncode, stderr_tail.strip(), ) @@ -1202,12 +1198,11 @@ def initialize(self, session_id: str, **kwargs: Any) -> None: if _install_bm_via_uv() is None: logger.error( "basic-memory: auto-install via uv failed. Run " - "`uv tool install basic-memory --prerelease=allow` manually to debug. " + "`uv tool install basic-memory` manually to debug. " "Provider will not initialize." ) self._record_init_failure( - "`uv tool install basic-memory --prerelease=allow` failed; " - "run it by hand to see why" + "`uv tool install basic-memory` failed; run it by hand to see why" ) return diff --git a/integrations/hermes/tests/test_provider.py b/integrations/hermes/tests/test_provider.py index 0d9bdd390..ab6338246 100644 --- a/integrations/hermes/tests/test_provider.py +++ b/integrations/hermes/tests/test_provider.py @@ -449,7 +449,7 @@ def _fake_run(argv, **kwargs): assert len(calls) == 1 argv = calls[0][0] assert argv[0] == "/fake/uv" - assert argv[1:] == ["tool", "install", "basic-memory", "--prerelease=allow", "--quiet"] + assert argv[1:] == ["tool", "install", "basic-memory", "--quiet"] def test_install_bm_via_uv_failed_returncode(bm, monkeypatch): diff --git a/integrations/openclaw/README.md b/integrations/openclaw/README.md index a22c980cb..e78f0b214 100644 --- a/integrations/openclaw/README.md +++ b/integrations/openclaw/README.md @@ -285,7 +285,7 @@ Cloud extends local-first — still plain Markdown, still yours. [Start a free t ## Troubleshooting -**`bm` not found** — Install uv, then restart the gateway. Or install manually: `uv tool install basic-memory --prerelease=allow` (the flag is required — basic-memory depends on a FastMCP pre-release, and without it uv silently installs an older release) +**`bm` not found** — Install uv, then restart the gateway. Or install manually: `uv tool install basic-memory` **Search returns nothing** — Check that Basic Memory connected (look for `connected to BM` in logs). Verify files exist in the project directory. diff --git a/integrations/openclaw/SECURITY.md b/integrations/openclaw/SECURITY.md index b0da0bd2c..558e14b40 100644 --- a/integrations/openclaw/SECURITY.md +++ b/integrations/openclaw/SECURITY.md @@ -7,8 +7,7 @@ On first startup, this plugin checks whether the `bm` (Basic Memory) CLI is avai ### What happens 1. The plugin checks if `bm` exists on `PATH` -2. If missing, it executes `uv tool install basic-memory --prerelease=allow --force` - (the flag is needed because basic-memory depends on a FastMCP pre-release) +2. If missing, it executes `uv tool install basic-memory --force` 3. This installs the Basic Memory CLI into uv's managed tool directory (`~/.local/bin/bm` on most systems) ### What this means @@ -23,7 +22,7 @@ On first startup, this plugin checks whether the `bm` (Basic Memory) CLI is avai You can install Basic Memory yourself before enabling the plugin: ```bash -uv tool install basic-memory --prerelease=allow +uv tool install basic-memory ``` Or with pip: diff --git a/integrations/openclaw/index.ts b/integrations/openclaw/index.ts index ca20b8e79..71353e71c 100644 --- a/integrations/openclaw/index.ts +++ b/integrations/openclaw/index.ts @@ -56,11 +56,9 @@ async function installBasicMemoryIfMissing(bmBin: string): Promise { } log.info("installing basic-memory via uv (this may take a minute)...") - // basic-memory pins a FastMCP pre-release; without this flag uv silently - // installs the last release that had none (#1338). const { stdout } = await execFileAsync( "uv", - ["tool", "install", "basic-memory", "--prerelease=allow", "--force"], + ["tool", "install", "basic-memory", "--force"], { encoding: "utf-8", timeout: 120_000 }, ) log.info(`basic-memory installed: ${stdout.trim().split("\n").pop()}`) diff --git a/integrations/openclaw/scripts/setup-bm.sh b/integrations/openclaw/scripts/setup-bm.sh index d128faa97..c7b20f4e3 100755 --- a/integrations/openclaw/scripts/setup-bm.sh +++ b/integrations/openclaw/scripts/setup-bm.sh @@ -16,17 +16,14 @@ if ! command -v uv >/dev/null 2>&1; then fi # ── install basic-memory ──────────────────────────────── -# basic-memory pins a FastMCP pre-release; without --prerelease=allow uv -# silently installs the last release that had none (#1338). if [[ -n "${BM_REF}" ]]; then echo "Installing basic-memory from ${BM_REPO}@${BM_REF} ..." uv tool install \ "basic-memory @ git+${BM_REPO}@${BM_REF}" \ - --prerelease=allow \ --force else echo "Installing latest basic-memory from PyPI ..." - uv tool install basic-memory --prerelease=allow --force + uv tool install basic-memory --force fi # ── verify ──────────────────────────────────────────────────────── diff --git a/llms-install.md b/llms-install.md index 7b76caf28..31e4b1e8f 100644 --- a/llms-install.md +++ b/llms-install.md @@ -10,10 +10,8 @@ steps in order. Use one of the following package managers to install: ```bash -# Install with uv (recommended). --prerelease=allow is required: basic-memory -# depends on a FastMCP pre-release, and without the flag uv silently installs -# an older release. -uv tool install basic-memory --prerelease=allow +# Install with uv (recommended) +uv tool install basic-memory # Or with pip pip install basic-memory @@ -29,7 +27,6 @@ Add the following to your config: "basic-memory": { "command": "uvx", "args": [ - "--prerelease=allow", "basic-memory", "mcp" ] diff --git a/plugins/claude-code/docs/getting-started.md b/plugins/claude-code/docs/getting-started.md index aabd89d01..98b6beb73 100644 --- a/plugins/claude-code/docs/getting-started.md +++ b/plugins/claude-code/docs/getting-started.md @@ -8,10 +8,8 @@ A ~5-minute walkthrough from zero to a working memory bridge. New to the idea? R - **Claude Code.** - **Basic Memory** with the 1.0 `bm_*` tool surface installed and connected as an MCP server: ```bash - uv tool install basic-memory --prerelease=allow + uv tool install basic-memory ``` - (`--prerelease=allow` is required: Basic Memory depends on a FastMCP pre-release, - and without the flag uv silently installs an older release.) Then add it to Claude Code (`claude mcp add` or your MCP config). Confirm it's reachable — Claude should be able to call `bm_project_list()`. diff --git a/plugins/claude-code/skills/bm-setup/SKILL.md b/plugins/claude-code/skills/bm-setup/SKILL.md index 96d097f67..9c3a64b63 100644 --- a/plugins/claude-code/skills/bm-setup/SKILL.md +++ b/plugins/claude-code/skills/bm-setup/SKILL.md @@ -20,11 +20,9 @@ First confirm the **Basic Memory MCP server is connected** — call wired into Claude Code yet. **Stop and walk the user through it first** (everything below depends on it): -1. Install it: `uv tool install basic-memory --prerelease=allow` (or - `pip install basic-memory`), a version exposing the 1.0 `bm_*` tools. Keep `--prerelease=allow` - with uv: published releases pin a FastMCP pre-release, and without the flag uv - silently installs an older Basic Memory release. -2. Connect it: `claude mcp add basic-memory -- uvx --prerelease=allow basic-memory mcp`, +1. Install it: `uv tool install basic-memory` (or + `pip install basic-memory`), a version exposing the 1.0 `bm_*` tools. +2. Connect it: `claude mcp add basic-memory -- uvx basic-memory mcp`, then restart the session so the MCP server loads. Re-check `bm_project_list()` before continuing — don't start the interview until @@ -62,7 +60,7 @@ Ask only what you can't infer. Cover: - *Cloud project* (the user wants capture in a cloud workspace): pass the `workspace` selector (a slug from `bm_project_list()`) and a cloud-style path like `/`, and create it with a **cloud-connected** MCP server. A purely - local server (`uvx --prerelease=allow basic-memory mcp`) treats the path as a local directory and + local server (`uvx basic-memory mcp`) treats the path as a local directory and fails to create it (e.g. read-only `/`). When both a local and a cloud server are connected, route creation *and* the schema seeding through the cloud one, and pin `primaryProject` to the new project's `external_id` UUID @@ -233,7 +231,7 @@ nudge — the config's presence is the signal that setup has run. Before you close, prove recall actually resolves — this catches a misnamed project, missing cloud credentials, or a ref that doesn't route, while the user is still here to fix it. Use the CLI the hook uses (`basic-memory` / `bm` / -`uvx --prerelease=allow basic-memory`). `--project` takes a project name, +`uvx basic-memory`). `--project` takes a project name, `workspace/project`, or a project id. - **Primary:** run the open-decision query the SessionStart hook runs against @@ -249,7 +247,7 @@ to fix it. Use the CLI the hook uses (`basic-memory` / `bm` / **error** means the ref doesn't route. - **Hook health:** run `basic-memory hook status --harness claude --project-dir ` with - the first available `basic-memory`, `bm`, or `uvx --prerelease=allow basic-memory` launcher. It + the first available `basic-memory`, `bm`, or `uvx basic-memory` launcher. It must find the intended settings and report the selected project and capture state. Record the shared inbox depth and last-flush state in the setup summary; the counts include envelopes from every supported harness. diff --git a/plugins/claude-code/skills/bm-status/SKILL.md b/plugins/claude-code/skills/bm-status/SKILL.md index b27cfce16..cfd5f04f3 100644 --- a/plugins/claude-code/skills/bm-status/SKILL.md +++ b/plugins/claude-code/skills/bm-status/SKILL.md @@ -17,7 +17,7 @@ when a default is configured. ## Gather 1. **CLI reachable?** Run `basic-memory --version`, then `bm --version`, then - `uvx --prerelease=allow basic-memory --version`. If no launcher resolves, report the CLI status as + `uvx basic-memory --version`. If no launcher resolves, report the CLI status as unavailable and continue with MCP/config checks. The plugin hooks can still use their uv-managed environment. diff --git a/plugins/codex/.mcp.json b/plugins/codex/.mcp.json index 0b8929fba..6e86668da 100644 --- a/plugins/codex/.mcp.json +++ b/plugins/codex/.mcp.json @@ -3,7 +3,6 @@ "basic-memory": { "command": "uvx", "args": [ - "--prerelease=allow", "basic-memory", "mcp" ] diff --git a/plugins/codex/skills/bm-setup/SKILL.md b/plugins/codex/skills/bm-setup/SKILL.md index 3182d7e1a..998d153a8 100644 --- a/plugins/codex/skills/bm-setup/SKILL.md +++ b/plugins/codex/skills/bm-setup/SKILL.md @@ -17,7 +17,7 @@ Confirm Basic Memory is reachable before changing files: 2. If MCP tools are not available, run `basic-memory --version` or `bm --version`. 3. If neither works, stop and tell the user to install Basic Memory and connect the MCP server. The plugin bundles an `.mcp.json` that starts - `uvx --prerelease=allow basic-memory mcp`. + `uvx basic-memory mcp`. 4. List available projects before the interview. Include cloud/local source, workspace, qualified name, and project id when available. @@ -205,7 +205,7 @@ Before closing, prove the mapping works: setup, confirm the `Coding Session` schema is present. - Search one shared project for open decisions if shared projects were configured. - Run `basic-memory hook status --harness codex --project-dir ` (using - `bm` or `uvx --prerelease=allow basic-memory` if needed). Confirm that it finds this repo's + `bm` or `uvx basic-memory` if needed). Confirm that it finds this repo's settings, reports the selected project, session profile, repository, and intended checkpoint-prompt and capture states. Its inbox counts are shared across harnesses. diff --git a/plugins/codex/skills/bm-status/SKILL.md b/plugins/codex/skills/bm-status/SKILL.md index 6ddeb6637..b8140516c 100644 --- a/plugins/codex/skills/bm-status/SKILL.md +++ b/plugins/codex/skills/bm-status/SKILL.md @@ -12,7 +12,7 @@ Gather a concise diagnostic. Do not over-investigate. 1. CLI reachability: - `basic-memory --version` - fallback `bm --version` - - fallback `uvx --prerelease=allow basic-memory --version` + - fallback `uvx basic-memory --version` Keep going if no launcher resolves. The plugin hook scripts can still use their uv-managed environment; report hook health as unavailable instead of diff --git a/server.json b/server.json index c98e81d20..3681d22e9 100644 --- a/server.json +++ b/server.json @@ -14,12 +14,6 @@ "version": "1.0.0", "runtimeHint": "uvx", "runtimeArguments": [ - { - "type": "named", - "name": "--prerelease", - "value": "allow", - "description": "basic-memory depends on a FastMCP pre-release; uv needs this to resolve it" - }, { "type": "positional", "value": "basic-memory" diff --git a/src/basic_memory/cli/auto_update.py b/src/basic_memory/cli/auto_update.py index 3a034f2e1..306783bcd 100644 --- a/src/basic_memory/cli/auto_update.py +++ b/src/basic_memory/cli/auto_update.py @@ -237,10 +237,19 @@ def release_notes_url(version: str) -> str: return f"{RELEASES_URL}/tag/v{version}" +# Installs before 1.1 were documented with --prerelease=allow, and uv saves that in +# the tool receipt and reuses it on every plain `uv tool upgrade`. Allowing every +# pre-release pulls unrelated alphas and release candidates (protobuf, redis, +# sqlite-vec) into the tool environment, and no dependency needs it anymore: 1.0 +# pinned a stable FastMCP. Passing uv's default mode explicitly replaces the saved +# setting, so each upgrade moves an old install back to the default (#2164). +UV_PRERELEASE_FLAG = "--prerelease=if-necessary-or-explicit" + + def _manual_update_hint(source: InstallSource) -> str: """Return manager-appropriate manual update instructions.""" if source == InstallSource.UV_TOOL: - return "Run `uv tool upgrade basic-memory --prerelease=allow`." + return f"Run `uv tool upgrade basic-memory {UV_PRERELEASE_FLAG}`." if source == InstallSource.HOMEBREW: return "Run `brew upgrade basic-memory`." return ( @@ -463,11 +472,8 @@ def run_auto_update( ) # --- Automatic install --- - # uv refuses the FastMCP pre-release basic-memory pins unless asked; - # without the flag the upgrade silently resolves to the previous - # release that had no pre-release dependencies (#1338). command = ( - ["uv", "tool", "upgrade", PACKAGE_NAME, "--prerelease=allow"] + ["uv", "tool", "upgrade", PACKAGE_NAME, UV_PRERELEASE_FLAG] if source == InstallSource.UV_TOOL else ["brew", "upgrade", PACKAGE_NAME] ) @@ -524,7 +530,7 @@ def run_auto_update( f"uv tool upgrade finished, but basic-memory is still {version_after} " f"(latest: {latest_version or 'unknown'}). The uv tool install " "probably pins this version; reinstall to change it: " - "uv tool install basic-memory --force --prerelease=allow" + f"uv tool install basic-memory --force {UV_PRERELEASE_FLAG}" ), ) updated_to = f" to {version_after}" diff --git a/src/basic_memory/cli/commands/hook.py b/src/basic_memory/cli/commands/hook.py index 9759f97a7..62a86a36f 100644 --- a/src/basic_memory/cli/commands/hook.py +++ b/src/basic_memory/cli/commands/hook.py @@ -1448,13 +1448,10 @@ def _hook_launcher() -> str: # Strip any .dev / +local / build suffix so the constraint is a clean release # floor (the shims pin the same way, bumped by update_versions). floor = basic_memory.__version__.split(".dev")[0].split("+")[0] - # basic-memory pins a FastMCP pre-release, and uv only accepts pre-releases - # of transitive dependencies when told to — without the flag a cold cache - # cannot resolve the floor at all (#1338). if shutil.which("uvx"): - return f'uvx --prerelease=allow "basic-memory>={floor}"' + return f'uvx "basic-memory>={floor}"' if shutil.which("uv"): - return f'uv tool run --prerelease=allow "basic-memory>={floor}"' + return f'uv tool run "basic-memory>={floor}"' return "basic-memory" diff --git a/src/basic_memory/cli/commands/install.py b/src/basic_memory/cli/commands/install.py index 3d2c546f4..b9584c00f 100644 --- a/src/basic_memory/cli/commands/install.py +++ b/src/basic_memory/cli/commands/install.py @@ -162,7 +162,6 @@ def install_claude_code( "basic-memory", "--", "uvx", - "--prerelease=allow", "basic-memory", "mcp", ), diff --git a/src/basic_memory/repository/litellm_provider.py b/src/basic_memory/repository/litellm_provider.py index 7534985a1..c0f1a4878 100644 --- a/src/basic_memory/repository/litellm_provider.py +++ b/src/basic_memory/repository/litellm_provider.py @@ -100,11 +100,11 @@ def _import_litellm() -> Any: raise SemanticDependenciesMissingError( "LiteLLM embeddings and reranking need the optional SDK. " "Install basic-memory[litellm], for example with " - '`uv tool install --force "basic-memory[litellm]" --prerelease=allow --python 3.14` or ' + '`uv tool install --force "basic-memory[litellm]" --python 3.14` or ' '`pip install "basic-memory[litellm]"`. ' "Include any other extras you use in the same specification. " "For Homebrew-managed installations, launch an isolated process with " - '`uvx --python 3.14 --prerelease=allow --from "basic-memory[litellm]" bm` ' + '`uvx --python 3.14 --from "basic-memory[litellm]" bm` ' "instead of the Cellar executable." ) from exc diff --git a/tests/cli/test_auto_update.py b/tests/cli/test_auto_update.py index c82a28112..772bdb400 100644 --- a/tests/cli/test_auto_update.py +++ b/tests/cli/test_auto_update.py @@ -540,7 +540,7 @@ def test_uv_tool_pypi_check_triggers_upgrade(monkeypatch, tmp_path): assert result.latest_version == "1.0.9" assert result.restart_recommended is True assert "updated to 1.0.9" in (result.message or "") - upgrade = ["uv", "tool", "upgrade", "basic-memory", "--prerelease=allow"] + upgrade = ["uv", "tool", "upgrade", "basic-memory", "--prerelease=if-necessary-or-explicit"] assert [command for command in calls if command[0] == "uv"] == [upgrade] # The tool's own interpreter reports the version before and after the upgrade. assert [command[0] for command in calls if command[0] != "uv"] == [UV_TOOL_PYTHON] * 2 diff --git a/tests/cli/test_hook_command.py b/tests/cli/test_hook_command.py index 93155ae13..668debfbc 100644 --- a/tests/cli/test_hook_command.py +++ b/tests/cli/test_hook_command.py @@ -1618,7 +1618,7 @@ def test_install_uses_uvx_launcher_when_no_binary_on_path(monkeypatch: pytest.Mo assert result.exit_code == 0 command = _read_json(_claude_settings_path())["hooks"]["SessionStart"][0]["hooks"][0]["command"] - assert command.startswith('uvx --prerelease=allow "basic-memory>=') + assert command.startswith('uvx "basic-memory>=') assert command.endswith("hook session-start --harness claude") # remove must still recognize the uvx form via the suffix-based ownership tag. @@ -1650,7 +1650,7 @@ def test_install_uses_uv_tool_run_when_only_uv(monkeypatch: pytest.MonkeyPatch) assert result.exit_code == 0 command = _read_json(_claude_settings_path())["hooks"]["SessionStart"][0]["hooks"][0]["command"] - assert command.startswith('uv tool run --prerelease=allow "basic-memory>=') + assert command.startswith('uv tool run "basic-memory>=') assert command.endswith("hook session-start --harness claude") @@ -1669,7 +1669,7 @@ def test_install_skips_stale_basic_memory_and_uses_uvx(monkeypatch: pytest.Monke assert result.exit_code == 0 command = _read_json(_claude_settings_path())["hooks"]["SessionStart"][0]["hooks"][0]["command"] - assert command.startswith('uvx --prerelease=allow "basic-memory>=') + assert command.startswith('uvx "basic-memory>=') assert command.endswith("hook session-start --harness claude") diff --git a/tests/cli/test_update_command.py b/tests/cli/test_update_command.py index 269703e01..8a2778fc7 100644 --- a/tests/cli/test_update_command.py +++ b/tests/cli/test_update_command.py @@ -48,7 +48,7 @@ def test_update_command_check_only_shows_available(monkeypatch): "basic_memory.cli.commands.update.run_auto_update", lambda **kwargs: _result( AutoUpdateStatus.UPDATE_AVAILABLE, - message="Update available (latest: 9.9.9). Run `uv tool upgrade basic-memory --prerelease=allow`.", + message="Update available (latest: 9.9.9). Run `uv tool upgrade basic-memory --prerelease=if-necessary-or-explicit`.", ), ) diff --git a/tests/repository/test_optional_litellm.py b/tests/repository/test_optional_litellm.py index 65a1abac1..4f1d217d0 100644 --- a/tests/repository/test_optional_litellm.py +++ b/tests/repository/test_optional_litellm.py @@ -65,8 +65,5 @@ async def test_missing_sdk_has_actionable_extra_instructions( assert reranker is not None await reranker.rerank("test", ["document"]) - assert ( - 'uv tool install --force "basic-memory[litellm]" --prerelease=allow --python 3.14' - in str(error.value) - ) + assert 'uv tool install --force "basic-memory[litellm]" --python 3.14' in str(error.value) assert 'pip install "basic-memory[litellm]"' in str(error.value)