diff --git a/core/server/admin.cpp b/core/server/admin.cpp index 760a5969..ff9197e0 100644 --- a/core/server/admin.cpp +++ b/core/server/admin.cpp @@ -441,7 +441,7 @@ json Server::capabilities() const { * state, plus the engine's, pre-rendered because the server knows nothing about devices, * containers or placement (ServerOptions::engine_info). `endpoints` is the router's own table, so * it cannot go stale. */ -HttpResponse Server::handle_server_info(const HttpRequest&) { +HttpResponse Server::handle_server_info(const HttpRequest& req) { json srv; srv["model"] = opt_.model_id; srv["version"] = opt_.version; @@ -508,8 +508,16 @@ HttpResponse Server::handle_server_info(const HttpRequest&) { json e = json::parse(opt_.engine_info, nullptr, false); if (e.is_discarded() || !e.is_object()) RAD_WARN("server: engine_info is not a JSON object; /server_info omits it"); - else + else { + /* One member names a file on this machine -- expert_stats.file, the xstats output, + * the same path the model card strips for strangers (server.cpp). /server_info + * answers keyless by the dashboard-data posture, but a filesystem path is not + * dashboard data: a stranger gets the interval, never the path. */ + if (opt_.api_key.empty() && !local_operator(req) && e.contains("expert_stats") && + e["expert_stats"].is_object()) + e["expert_stats"].erase("file"); o["engine"] = std::move(e); + } } metrics_.observe_http(200); return HttpResponse::json_body(200, json_dump(o)); diff --git a/core/server/server.cpp b/core/server/server.cpp index 7157a0c6..44daa3b7 100644 --- a/core/server/server.cpp +++ b/core/server/server.cpp @@ -2316,6 +2316,9 @@ HttpResponse Server::handle_models(const HttpRequest& req) { * belongs to the operator alone, the rule /diagnostics and the LoRA admin follow; with a * key, everyone who can pay the key already owns this model's card. */ if (!opt_.api_key.empty() || local_operator(req)) c.root = opt_.model_path; + /* No capabilities member to strip here: capabilities() carries no expert_stats. The engine + * reports that path in its own info blob, and the splice at /server_info screens it for + * keyless strangers (admin.cpp, handle_server_info) -- the live guard, this is the map. */ c.capabilities = capabilities().dump(); metrics_.observe_http(200); std::vector cards{ c };