From 65a9e78acf8d11bb0eca4193f48909747326a937 Mon Sep 17 00:00:00 2001 From: Brandon Bertelsen Date: Wed, 28 Oct 2026 03:00:56 -0400 Subject: [PATCH] rad-convert: clef needs --arch clef, refused otherwise --- tests/clef_decision_test.cpp | 7 +++++++ tools/rad_convert.cpp | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/clef_decision_test.cpp b/tests/clef_decision_test.cpp index 9a6f42e0..8c3f0992 100644 --- a/tests/clef_decision_test.cpp +++ b/tests/clef_decision_test.cpp @@ -393,6 +393,13 @@ TEST(a_clef_convert_without_the_head_is_refused) { "--set", "decision.type=clef" }, engine_env(), &log, 300); CHECK(st != 0); CHECK(log.find("joint_head.safetensors") != std::string::npos); + /* And one that keeps the qwen35 id: the head would never run, so the convert refuses it. */ + log.clear(); + const int st2 = tiny::run({ RAD_E2E_CONVERT, ck, "-o", dir / "no-arch.rad", "--add", + ck + "/joint_head.safetensors", "--set", "decision.type=clef" }, + engine_env(), &log, 300); + CHECK(st2 != 0); + CHECK(log.find("--arch clef") != std::string::npos); } RAD_TEST_MAIN() diff --git a/tools/rad_convert.cpp b/tools/rad_convert.cpp index 2a881c15..3eeb31cf 100644 --- a/tools/rad_convert.cpp +++ b/tools/rad_convert.cpp @@ -58,6 +58,14 @@ bool file_exists(const std::string& p) { std::ifstream f(p); return (bool)f; } * (arch/common/rad_block_clef.h) and the server applies the scalars (core/server/clef.h). */ int clef_metadata(const std::string& in, const std::string& config_dir, const Checkpoint& ck, MetaOwn& meta) { + /* The head lives in the clef plugins, selected by the architecture id. A container that + * says decision.type=clef but keeps its qwen35 id would load the trunk alone and answer + * /v1/systemone from a head that never ran. */ + if (meta.arch != "clef") { + RAD_ERR("%s: decision.type=clef needs the clef plugins: convert with --arch clef (the " + "container's architecture is '%s')", in.c_str(), meta.arch.c_str()); + return -1; + } std::string dir = config_dir; if (dir.empty()) { struct stat st{};