From dd4def25fa2f1c9ca6db44bedec687b34a2f5175 Mon Sep 17 00:00:00 2001 From: Albert Wang Date: Mon, 11 May 2026 15:39:54 +0800 Subject: [PATCH] fix(providers): set supports_max_completion_tokens for VolcEngine providers VolcEngine's OpenAI-compatible gateway rejects requests when both max_tokens and max_completion_tokens are present (the latter added by openai-python SDK v2.x serialization). Set the flag so nanobot sends max_completion_tokens instead of max_tokens for volcengine, volcengine_coding_plan, and by extension byteplus variants. Co-Authored-By: Claude Opus 4.7 --- nanobot/providers/registry.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nanobot/providers/registry.py b/nanobot/providers/registry.py index eb025e771..3eda6c5a4 100644 --- a/nanobot/providers/registry.py +++ b/nanobot/providers/registry.py @@ -192,6 +192,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = ( detect_by_base_keyword="volces", default_api_base="https://ark.cn-beijing.volces.com/api/v3", thinking_style="thinking_type", + supports_max_completion_tokens=True, ), # VolcEngine Coding Plan (火山引擎 Coding Plan): same key as volcengine @@ -205,6 +206,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = ( default_api_base="https://ark.cn-beijing.volces.com/api/coding/v3", strip_model_prefix=True, thinking_style="thinking_type", + supports_max_completion_tokens=True, ), # BytePlus: VolcEngine international, pay-per-use models