Skip to content

fix(cli): upgrade companion binaries and ORT libs, normalize version compare - #1255

Merged
ajianaz merged 2 commits into
developfrom
fix/upgrade-companion-binaries
Sep 15, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/upgrade-companion-binaries

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

What

uteke upgrade now keeps every installed artifact in sync with the release bundle:

  1. Companion binaries - uteke-serve and uteke-mcp are replaced from the same checksum-verified archive as the CLI. Each is run-verified (--version) and atomically renamed; a bundle missing them (pre-0.17-style) is skipped with a warning, not an error.
  2. ONNX Runtime libs - bundled libonnxruntime* files are refreshed into the install dir (install.sh has installed these since fix(install): copy bundled ORT libs on binary install #1221; the upgrade path discarded them). Unix symlinks are recreated; non-Unix platforms keep their installed libs.
  3. Version comparison - the latest release tag (v0.18.0) is compared against CARGO_PKG_VERSION (0.18.0) with the v prefix normalized. Previously an up-to-date install was always re-offered the same release.

Why

Verified E2E on a clean sandbox (v0.17.0 via install.sh -> uteke upgrade --yes): the CLI moved 0.17.0 -> 0.18.0 while uteke-serve, uteke-mcp, and the ORT libs kept their exact pre-upgrade SHAs, and the running server stayed stale until manually restarted with the old binary - a "successful" upgrade that left the server a version behind. The v-prefix mismatch additionally makes an up-to-date 0.18.0 install re-offer v0.18.0. Closes #1245.

Testing

  • New unit tests: replace_binary installs a verified fake binary, skips missing optional artifacts, hard-fails on missing required ones, and refuses a broken artifact without installing it.
  • E2E on this host: old binary re-offers v0.18.0 on an up-to-date install; fixed binary reports Already up to date (0.18.0).
  • cargo test -p uteke-cli --bins: 75 passed / 0 failed. cargo fmt --check + cargo clippy --bins -- -D warnings clean.

…compare

`uteke upgrade` replaced only the CLI binary: `uteke-serve` and `uteke-mcp`
stayed on the old version after a "successful" upgrade, and the freshly
downloaded ONNX Runtime libs bundled since #1221 were discarded.

- Replace `uteke-serve` and `uteke-mcp` from the same verified archive
  (warn+skip when absent from older bundles; per-binary run verification
  and atomic rename preserved)
- Refresh bundled `libonnxruntime*` libs from the archive (symlinks
  preserved on Unix; other platforms keep installed libs)
- Compare the latest release tag against CARGO_PKG_VERSION with the `v`
  prefix normalized - an up-to-date install was re-offered the same release

Closes #1245
.map_err(|e| format!("Failed to stat {fname}: {e}"))?;
if ft.is_file() {
fs::copy(entry.path(), &dest).map_err(|e| format!("Failed to install {fname}: {e}"))?;
refreshed += 1;
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

Copying bundled libonnxruntime files over the installed ones in place
truncates the live lib while a running uteke-serve may still have it
mmap'd (SIGBUS), and an interrupted copy leaves a corrupt lib after
the binaries were already swapped. Stage to a temp name and rename
atomically, matching the replace_binary pattern.
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.

enhancement(upgrade): uteke upgrade should update uteke-serve and uteke-mcp too, not just the CLI binary

2 participants