Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

fix(api): GET /_xpack respects --compat-version, was hardcoded 8.13.0

Vincenzo Lombardo19b18a4beeac
diff --git a/engine/crates/xerj-api/src/es_compat.rs b/engine/crates/xerj-api/src/es_compat.rs
index 88d05ab68..9402895b0 100644
--- a/engine/crates/xerj-api/src/es_compat.rs
+++ b/engine/crates/xerj-api/src/es_compat.rs
@@ -22116,13 +22116,28 @@ pub async fn xpack_info(State(state): State<AppState>) -> impl IntoResponse {
let watcher_enabled = state
.watcher_active
.load(std::sync::atomic::Ordering::Relaxed);
+ // Must match GET / (`resolve_compat_version`'s `--compat-version`
+ // override) — found empirically: Kibana cross-checks the cluster
+ // version it saw on GET / against the version reported here before
+ // trusting the license block, so a mismatch (GET / correctly
+ // reporting an overridden older version, this endpoint still
+ // hardcoding "8.13.0") surfaces as an opaque "license not available"
+ // error rather than a version-mismatch message. `/_xpack` is
+ // Elastic-only (OpenSearch has no equivalent endpoint), so only the
+ // plain `--compat-version` override applies here, not the fuller
+ // OpenSearch auto-detection `resolve_compat_version` also does.
+ let reported_version = if state.config.compat.version.is_empty() {
+ "8.13.0".to_string()
+ } else {
+ state.config.compat.version.clone()
+ };
Json(json!({
"build": {
"hash": "xerj",
"date": "2024-01-01T00:00:00.000Z"
},
"version": {
- "number": "8.13.0",
+ "number": reported_version,
"build_flavor": "default",
"build_type": "docker",
"minimum_wire_compatibility_version": "7.17.0",