From 2938d8159b9b7291c740806f47828d062fef1586 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 8 Mar 2026 00:21:38 +0000 Subject: [PATCH] fix: strip AIUI-specific fields from Claude API proxy requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove webSearch, webResults, context fields before forwarding to Anthropic API — these are AIUI-internal and cause 400 errors. Co-Authored-By: Claude Opus 4.6 --- neode-ui/mock-backend.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/neode-ui/mock-backend.js b/neode-ui/mock-backend.js index 397896b7..0a9877b8 100755 --- a/neode-ui/mock-backend.js +++ b/neode-ui/mock-backend.js @@ -1031,10 +1031,14 @@ app.post('/aiui/api/claude/*', (req, res) => { const apiPath = '/' + req.params[0] - // Ensure max_tokens is set — Claude API requires it but AIUI may omit it + // Clean request body for Anthropic API const body = req.body - if (body && !body.max_tokens) { - body.max_tokens = 4096 + if (body) { + if (!body.max_tokens) body.max_tokens = 4096 + // Strip AIUI-specific fields that Anthropic API rejects + delete body.webSearch + delete body.webResults + delete body.context } const bodyStr = JSON.stringify(body)