feat: add update check to all surfaces (CLI, MCP, HTTP) - #990
Merged
Conversation
Move update-check logic from uteke-cli to uteke-core so all three runtime surfaces share one code path. Each surface now notifies users when a newer version is available. Core (uteke-core/src/update_check.rs): - UpdateInfo struct with is_update_available() + banner() - check_cached(): instant cache lookup (24h TTL) - check_network(): blocking GitHub fetch, updates cache - check(): cached first, falls back to network - check_and_notify(): prints banner to stderr if update available - Cache file: ~/.config/uteke/update-cache.json - Primary: GitHub 302 redirect (no API rate limit) - Fallback: GitHub REST API - 5 unit tests for version comparison + banner formatting MCP server: - Spawn detached background thread at startup - Writes to stderr (MCP uses stdout for JSON-RPC) - Uses check() which tries cache first HTTP server: - Background thread: check on startup + every 24h - Logs via warn! for structured log visibility - /health endpoint gains update_available field (from cache) - Periodic loop respects SHUTDOWN flag (hourly wake for fast exit) CLI (thin wrapper): - Calls uteke_core::update_check::check_cached/check_network - Respects update_check = false from uteke.toml (CLI-only config) Tests: 479 pass, 0 fail, 0 warnings, 0 clippy errors
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (1)
Review powered by cora-code · BYOK · MIT |
- HTTP server update thread now tries cache before hitting network - Regenerate docs/api-reference.md for new update_available field
Avoid hardcoded repo path in strip_prefix — use format! with REPO constant so it stays in sync if the repo path ever changes.
|
|
||
| if let Some(location) = resp.headers().get("location") { | ||
| let loc = location.to_str().unwrap_or_default(); | ||
| let prefix = format!("/{REPO}/releases/tag/"); |
ajianaz
added a commit
that referenced
this pull request
Aug 10, 2026
* fix(core): handle absolute URLs in update check redirect parser GitHub 302 redirects return absolute URLs (https://github.com/codecoradev/uteke/releases/tag/v0.13.1), not relative paths. The previous strip_prefix('/codecoradev/...') always failed on absolute URLs, falling through to the rsplit fallback which required a 'v' prefix. Fix: use find() to locate the tag marker anywhere in the URL, and relax the rsplit fallback to accept any non-empty tag. Found by Cora Code review on PR #990. * fix(core): use split_once for UTF-8 safe URL parsing in update check Cora finding: byte-indexed slicing (&loc[idx+len..]) could panic on non-char-boundary if Location header contains multi-byte UTF-8. Replace with split_once() — idiomatic, zero-cost, UTF-8 safe. --------- Co-authored-by: ajianaz <ajianaz@users.noreply.github.com>
Merged
ajianaz
added a commit
that referenced
this pull request
Aug 11, 2026
Version bump 0.13.1 → 0.13.2 + CHANGELOG. Changes since v0.13.1: - feat: update check (CLI, MCP, HTTP) (#990) - fix: NULL embeddings crash vector index (#992, #993) - fix: absolute URL in update check redirect (#994) - fix: LongMemEval benchmark threshold false negatives (#995, #996) - chore: branding refresh (#991) Co-authored-by: ajianaz <ajianaz@users.noreply.github.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.
What
Move update-check logic from uteke-cli to uteke-core so all three runtime surfaces (CLI, MCP server, HTTP server) share one code path. Each surface now notifies users when a newer version is available on GitHub.
Why
Users running uteke via MCP (Claude Code, Cursor, Copilot) or HTTP server (Docker containers, long-running processes) had no way to know when a new version was released. Only CLI users got the startup notification. Now all surfaces check and notify.
Changes
Core (uteke-core/src/update_check.rs) - new shared module with cached check + network check + banner formatting. 5 unit tests included.
MCP server - detached background thread at startup, writes to stderr.
HTTP server - background thread with cache-first check on startup + every 24h. Health endpoint gains update_available field.
CLI - thin wrapper over core. Config opt-out preserved.
Testing
cargo test --workspace: 479 pass, 0 fail. Clippy: 0 warnings. Fmt: clean.