Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ucode/agents/claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ def _ensure_mlflow_cli() -> bool:
return False

print_note(f"{'Replacing' if current else 'Installing'} the mlflow CLI ({MLFLOW_CLI_SPEC})...")
# --force replaces an existing (out-of-range) uv-managed mlflow in place.
cmd = ["uv", "tool", "install", MLFLOW_CLI_SPEC]
if current:
cmd.append("--force")
# Always --force: it installs fresh when absent and replaces in place when
# present. Keying it on `current` broke when an mlflow existed but its
# version couldn't be parsed — uv still errors "Executable already exists".
cmd = ["uv", "tool", "install", "--force", MLFLOW_CLI_SPEC]
try:
subprocess.run(cmd, check=True, timeout=600)
except (OSError, subprocess.CalledProcessError, subprocess.TimeoutExpired) as exc:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,9 @@ def test_installs_when_missing(self, monkeypatch):
cmd = run.call_args[0][0]
assert cmd[:3] == ["uv", "tool", "install"]
assert claude.MLFLOW_CLI_SPEC in cmd
assert "--force" not in cmd
# Always --force so an unparseable-version mlflow on disk doesn't trip
# uv's "Executable already exists" error.
assert "--force" in cmd

def test_force_replaces_when_below_minimum(self, monkeypatch):
monkeypatch.setattr(claude, "_installed_mlflow_version", lambda: (3, 4))
Expand Down
Loading