From 3c6fe00ae1e187ebc98c778d14a0797086e08127 Mon Sep 17 00:00:00 2001 From: Aji Anaz Date: Thu, 9 Jul 2026 22:36:32 +0700 Subject: [PATCH 1/2] feat(server): report version in /health response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a `version` field (uteke-server crate version) to GET /health so HTTP clients can gate features on the actual server capability. This matters for remote deployments: Corin previously derived the uteke version from the local `uteke` CLI, which is meaningless when talking to a user-managed remote server that may be older or newer. With /health reporting version, clients can probe the server directly. Backward compatible — `version` is an added JSON field. --- crates/uteke-server/src/handlers.rs | 1 + crates/uteke-server/src/main.rs | 2 +- crates/uteke-server/src/types.rs | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/uteke-server/src/handlers.rs b/crates/uteke-server/src/handlers.rs index 999c8638..e8480624 100644 --- a/crates/uteke-server/src/handlers.rs +++ b/crates/uteke-server/src/handlers.rs @@ -93,6 +93,7 @@ pub fn route(uteke: &Mutex, ctx: &ReqCtx, req: &mut Request) -> Response< req, &HealthResponse { status: "ok", + version: env!("CARGO_PKG_VERSION"), memories: total, namespaces, }, diff --git a/crates/uteke-server/src/main.rs b/crates/uteke-server/src/main.rs index b36f285a..56248314 100644 --- a/crates/uteke-server/src/main.rs +++ b/crates/uteke-server/src/main.rs @@ -113,7 +113,7 @@ fn main() { println!(" Configure CORS origins in uteke.toml [server].cors_origins."); println!(); println!("API:"); - println!(" GET /health → {{ status, memories }}"); + println!(" GET /health → {{ status, version, memories, namespaces }}"); println!(" POST /remember → {{ content, tags? }} → {{ id }}"); println!(" POST /recall → {{ query, limit? }} → {{ results }}"); println!(" POST /search → {{ query, limit? }} → {{ results }}"); diff --git a/crates/uteke-server/src/types.rs b/crates/uteke-server/src/types.rs index 293ce685..d0a88b5e 100644 --- a/crates/uteke-server/src/types.rs +++ b/crates/uteke-server/src/types.rs @@ -172,6 +172,9 @@ pub struct ListParams { #[derive(Serialize)] pub struct HealthResponse { pub status: &'static str, + /// Server version (uteke-server crate version), so HTTP clients can gate + /// features on the actual server capability rather than a local CLI probe. + pub version: &'static str, pub memories: usize, pub namespaces: usize, } From d90aa359d26016516a743ec928e4957d9e2a4aa2 Mon Sep 17 00:00:00 2001 From: Aji Anaz Date: Thu, 9 Jul 2026 22:43:15 +0700 Subject: [PATCH 2/2] style: wrap /health help line to satisfy rustfmt max_width CI rustfmt wraps the >100-col println! to match the existing /list help-text convention; local fmt did not flag it (toolchain mismatch). --- crates/uteke-server/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/uteke-server/src/main.rs b/crates/uteke-server/src/main.rs index 56248314..e85301c4 100644 --- a/crates/uteke-server/src/main.rs +++ b/crates/uteke-server/src/main.rs @@ -113,7 +113,9 @@ fn main() { println!(" Configure CORS origins in uteke.toml [server].cors_origins."); println!(); println!("API:"); - println!(" GET /health → {{ status, version, memories, namespaces }}"); + println!( + " GET /health → {{ status, version, memories, namespaces }}" + ); println!(" POST /remember → {{ content, tags? }} → {{ id }}"); println!(" POST /recall → {{ query, limit? }} → {{ results }}"); println!(" POST /search → {{ query, limit? }} → {{ results }}");