[Bugfix] Fix Anthropic Thinking Disabled with P/D (#58786)

Signed-off-by: Robert Shaw <robshaw@redhat.com>
Co-authored-by: Robert Shaw <robshaw@redhat.com>
This commit is contained in:
Robert Shaw
2026-09-26 13:50:57 +00:00
committed by GitHub
co-authored by Robert Shaw
parent ad6817b68d
commit d64f277c54
2 changed files with 26 additions and 0 deletions
+4
View File
@@ -233,6 +233,10 @@ class AnthropicMessagesRequest(BaseModel):
@model_validator(mode="after")
def validate_thinking_budget(self) -> "AnthropicMessagesRequest":
# P/D prefill legs are sent with max_tokens=1 and never decode; the
# decode leg carries the client's max_tokens and is still checked.
if self.kv_transfer_params and self.kv_transfer_params.get("do_remote_decode"):
return self
if (
isinstance(self.thinking, AnthropicThinkingConfigEnabled)
and self.thinking.budget_tokens >= self.max_tokens