From 2cede55386c72faecf4cba22fbf546a589ccfdd0 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Fri, 13 Nov 2026 00:02:53 -0400 Subject: [PATCH] serve: main does not compile at the #2327 image refusal -- one brace short (fix-forward) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2327 added the "this route has no vision wiring" refusal and left the nlohmann initialiser one `}` short, so `1bit` does not build on main at all: app/forward_serve.cpp:282:76: error: expected '}' before '.' token Counted: after {"code", 400} the statement needs four closings -- the code pair, the inner ordered_json, the {"error", …} pair and the outer initialiser -- and it has three. Rather than add the missing brace to a 6-line nested initialiser, the body is written the way the other error responses in this file are written (a named ordered_json), so the next reader does not have to count braces to see what it says. The message text is unchanged. Found while about to import a container: the acceptance-case import needs a working `1bit`, and main had none. No open PR covered it (searched before touching it). --- app/forward_serve.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/forward_serve.cpp b/app/forward_serve.cpp index 3724e313d..bab353fd1 100644 --- a/app/forward_serve.cpp +++ b/app/forward_serve.cpp @@ -274,12 +274,18 @@ void handle_generate_impl(ForwardEngine& e, const httplib::Request& req, httplib // than rendered as text and answered. The chain it would call exists; the parse and the join here do not. if (npu::message_carries_an_image(ordered.at("messages"))) { res.status = 400; - res.set_content(nlohmann::ordered_json{{"error", nlohmann::ordered_json{{"message", - "this route has no vision wiring yet (engine#2324): the request carries an image part and the " - "NPU route parses no pixels, so answering it would ignore the picture. Text-only requests are " - "unaffected. The vision chain exists (npu/vision_tower.h and friends) and is driven by " - "npu/forward/minicpm_image_probe.cpp; the serve-side parse and the image positions are what is missing."}, - {"type", "unsupported_image_part"}, {"code", 400}}}.dump(), "application/json"); + // engine#2327 left this one brace short of compiling; written the way the other error bodies in + // this file are, so the next reader does not have to count braces to see what it says. + nlohmann::ordered_json body_out; + body_out["error"] = { + {"message", + "this route has no vision wiring yet (engine#2324): the request carries an image part and the " + "NPU route parses no pixels, so answering it would ignore the picture. Text-only requests are " + "unaffected. The vision chain exists (npu/vision_tower.h and friends) and is driven by " + "npu/forward/minicpm_image_probe.cpp; the serve-side parse and the image positions are what is missing."}, + {"type", "unsupported_image_part"}, + {"code", 400}}; + res.set_content(body_out.dump(), "application/json"); return; } // An earlier call's arguments arrive as a JSON string; the template is written against the