From dbfb925f656d5022f7d4221565800cf21476ef4e Mon Sep 17 00:00:00 2001 From: qing <1776177662@qq.com> Date: Fri, 21 Aug 2026 15:01:56 +0000 Subject: [PATCH] =?UTF-8?q?fix(robot=5Fagent):=20=E7=94=A8=20boost::system?= =?UTF-8?q?::error=5Fcode=20=E6=9B=BF=E4=BB=A3=E5=B7=B2=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=9A=84=20json::error=5Fcode=20=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新版 Boost(1.85+)移除了 boost::json::error_code 废弃别名, 改用 boost::system::error_code 以兼容新旧版本。 --- robot_agent/agent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/robot_agent/agent.cpp b/robot_agent/agent.cpp index 9f3a7db..7a73c04 100644 --- a/robot_agent/agent.cpp +++ b/robot_agent/agent.cpp @@ -2,6 +2,8 @@ #include +#include + #include #include #include @@ -90,7 +92,7 @@ std::string run_chat_loop(const AgentConfig& cfg, if (code != 200) throw std::runtime_error("HTTP " + std::to_string(code) + ": " + response_body); - json::error_code ec; + boost::system::error_code ec; json::value resp = json::parse(response_body, ec); if (ec) throw std::runtime_error("响应不是合法 JSON: " + response_body.substr(0, 200)); @@ -119,7 +121,7 @@ std::string run_chat_loop(const AgentConfig& cfg, auto args_it = fn.find("arguments"); if (args_it != fn.end() && !args_it->value().is_null()) { std::string args_str = json::value_to(args_it->value()); - json::error_code aec; + boost::system::error_code aec; args = json::parse(args_str, aec); if (aec) args = json::object(); } else {