From a655a95378ef7a1b43c7a85a74d7650427bd65ec Mon Sep 17 00:00:00 2001 From: hksdpc255 <43977088+hksdpc255@users.noreply.github.com> Date: Mon, 16 Mar 2026 18:57:09 +1100 Subject: [PATCH] Prevent adding content that starts with 'x-anthropic-' to system_content. (#1436) --- examples/server/server-common.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/server/server-common.cpp b/examples/server/server-common.cpp index 8c3e8b23..2a0fdc5d 100644 --- a/examples/server/server-common.cpp +++ b/examples/server/server-common.cpp @@ -1202,8 +1202,11 @@ json anthropic_params_from_json( } else if (system_param.is_array()) { for (const auto& block : system_param) { - if (json_value(block, "type", std::string()) == "text") { - system_content += json_value(block, "text", std::string()); + if (json_value(block, "type", std::string()) == "text") { + std::string content_block = json_value(block, "text", std::string()); + if (!string_starts_with(content_block, "x-anthropic-")) { + system_content += content_block; + } } } }