When extended thinking is enabled, the websearch interception agentic loop
builds a follow-up assistant message with only tool_use blocks. Anthropic's
API requires assistant messages to start with thinking/redacted_thinking
blocks when thinking is enabled, causing a 400 Bad Request.
Extract thinking blocks from the model's initial response, thread them
through the agentic loop, and prepend them to the follow-up assistant
message — matching the pattern used by anthropic_messages_pt in factory.py.
Fixes the error: "Expected 'thinking' or 'redacted_thinking', but found
'tool_use'"
The `router` name is already re-exported via `from .endpoints import *`,
making the explicit `from .endpoints import (router,)` on the following
lines redundant and triggering ruff F401 (imported but unused).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* add spec_path column to LiteLLM_MCPServerTable schema
* add spec_path to MCP request types and table model
* wire spec_path through build_mcp_server_from_table
* add openapi transport type constant
* add OpenAPI Spec as first-class transport option in create form
* add OpenAPI transport support to edit form with auto-detection
* support spec_path in connection status component
* support spec_path in tool configuration component
* support OpenAPI transport in test connection hook
* register OpenAPI tools on server add/update/reload
* preview OpenAPI tools in test/tools/list endpoint
* fix aviation safety topic filter: remove overly broad exceptions, add cockpit access block words
* fix airline brand protection filter: add identifier words, competitor/ops block words, tighten exceptions
* add example_sentences to all policy templates + topic-filtering and prompt-injection templates
* add policy_endpoints package with AI policy suggester
* update test patch targets for policy_endpoints package move
* add unit tests for AI policy suggester
* add suggestPolicyTemplates networking function
* add AI suggestion modal component
* add Use AI button and template loading callback to PolicyTemplates
* wire up AI suggestion modal in policies page
* fix policy_templates_backup.json path after package move
* add estimated_latency field to all policy templates
* use llm_router and accept model parameter in ai_policy_suggester
* add model param to suggest templates endpoint
* pass model param in suggestPolicyTemplates
* polish ai suggestion modal: model selector, auto-growing textareas, latency badges
* add template queue for processing multiple AI-suggested templates
* show template progress badge in guardrail selection modal
Moonshot's _transform_messages unconditionally flattened content arrays
to plain text, dropping image_url blocks. Vision models like kimi-k2.5
accept the standard OpenAI content array format.
Now checks for image_url blocks before flattening — if any message
contains images the content array is preserved intact.
Fixes#20862
AgentCore MCP server endpoints require the Accept header to contain
both application/json and text/event-stream per the MCP specification
(Streamable HTTP transport). Without this header, requests are rejected
with a 406 Not Acceptable error (JSON-RPC code -32011).
Sets the Accept header at the top of sign_request() so both JWT/Bearer
and SigV4 authentication paths include it.
* fix(scim): handle deprovisioning operations without path field
When SCIM providers send deprovisioning requests without a path field
(e.g., {"op": "replace", "value": {"active": false}}), the code was
storing the value under an empty string key in metadata.
This fix:
- Detects operations with no path where value is a dict
- Extracts and handles known fields like 'active' correctly
- Sets metadata["scim_active"] = false instead of metadata[""] = {"active": false}
Fixes: SCIM deprovisioning creating empty string keys in user metadata
* fix(scim): handle all known fields in operations without path
Extended the fix to handle all SCIM fields (not just active) when
operations have no path field:
- active -> scim_active
- displayName -> user_alias
- externalId -> user_id
- name.givenName/familyName -> scim_metadata
Added comprehensive test for multiple fields without path.
Addresses Greptile review feedback on RFC 7644 compliance.
* trigger PR update
When providers like OpenRouter send a usage chunk after the finish_reason
chunk, _hidden_params["usage"] was already calculated (with zeros) before
the usage data arrived. The StopIteration handler now recalculates usage
from stream_chunk_builder and updates the shared _hidden_params dict so
the user's copy reflects the real provider-reported token counts.
Fixes#20760
Move the fix to the OpenRouter level: define native OpenRouter models
(openrouter/auto, openrouter/free, openrouter/bodybuilder) and check
them in get_llm_provider() before the provider_list stripping logic.
This prevents the second strip across all bridges without modifying
each adapter/handler individually.
Fixes#16353
aspectRatio and imageSize were silently dropped because they weren't
listed in get_supported_openai_params(), so the validation layer filtered
them out before they could reach transform_image_generation_request().
Fixes#21070
logprobs, top_p, top_logprobs are only accepted by OpenAI when
reasoning_effort="none". Add validation matching the existing
temperature logic: raise UnsupportedParamsError or drop when
reasoning_effort is set to other values.
The Apertus 8B and 70B models do not support standard OpenAI-style
tool calling. Per Swiss AI's docs, tool use integration into inference
engines is still in development. Set supports_function_calling and
supports_tool_choice to false.
Fixes#21124
validate_environment() resolved AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT
from the env var but only returned headers. get_complete_url() still
received None and raised ValueError. Now get_complete_url() also
resolves the env var as a fallback.
Fixes#21034
Gemini returns finishReason="STOP" even when tool calls are present,
and sends tool_calls and finishReason in separate streaming chunks.
The ModelResponseIterator now tracks tool_calls across chunks and
correctly maps finish_reason to "tool_calls" per the OpenAI spec.
Fixes#21041
Remove logit_bias, modalities, prediction, audio, web_search_options
from supported params for all GPT-5 reasoning models (OpenAI rejects
them). Add logprobs, top_p, top_logprobs for gpt-5.1/5.2 which support
them when reasoning_effort="none".
Related to #21572
gpt-5-search-api models were routed through OpenAIGPT5Config which
listed params like n, temperature, tools, reasoning_effort as supported,
but OpenAI rejects all of these for search models.
Fixes#21572