From 2693fd77b75e068c68d8d9876f7ae8fe45a59e44 Mon Sep 17 00:00:00 2001 From: shaw Date: Wed, 7 Jan 2026 16:21:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4context=5Fmanagement?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E9=81=BF=E5=85=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/api.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/routes/api.js b/src/routes/api.js index c38c4d6f..c43ce90a 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -179,18 +179,18 @@ async function handleMessagesRequest(req, res) { const isStream = req.body.stream === true // 临时修复新版本客户端,删除context_management字段,避免报错 - // if (req.body.context_management) { - // delete req.body.context_management - // } + if (req.body.context_management) { + delete req.body.context_management + } // 遍历tools数组,删除input_examples字段 - // if (req.body.tools && Array.isArray(req.body.tools)) { - // req.body.tools.forEach((tool) => { - // if (tool && typeof tool === 'object' && tool.input_examples) { - // delete tool.input_examples - // } - // }) - // } + if (req.body.tools && Array.isArray(req.body.tools)) { + req.body.tools.forEach((tool) => { + if (tool && typeof tool === 'object' && tool.input_examples) { + delete tool.input_examples + } + }) + } logger.api( `🚀 Processing ${isStream ? 'stream' : 'non-stream'} request for key: ${req.apiKey.name}`