litellm/litellm
devin-ai-integration[bot] e073cd3aeb
fix(mcp): write failure spend log for guardrail-blocked /mcp-rest/tools/call (#40555)
* fix(mcp): write failure spend log for guardrail-blocked /mcp-rest/tools/call

call_tool_rest_api only translated exceptions to HTTP responses, so a pre_mcp_call
guardrail block never reached failure_handler / async_failure_handler /
post_call_failure_hook and no LiteLLM_SpendLogs failure row was written. Extract
the failure logging from call_mcp_tool into _fire_mcp_tool_call_failure_logging
and run it in the REST route for anything raised between
common_processing_pre_call_logic and execute_mcp_tool

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): keep the original REST tool error when failure logging raises

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): log virtual mcp_tool_call failures and keep REST success latency scoped to tool execution

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 12:54:03 -07:00
..
a2a_protocol fix(bedrock): sign on a dedicated executor instead of the shared default one 2026-09-09 18:52:00 -07:00
anthropic_interface fix(anthropic_endpoints): return Anthropic type:error envelope for /v1/messages errors 2026-08-31 16:23:36 -07:00
assistants refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
batch_completion
batches Merge pull request #39626 from BerriAI/litellm_batch_ui_logs 2026-09-08 15:19:25 -07:00
caching feat(proxy): make the in-memory management cache capacity configurable (#40725) 2026-09-11 09:55:30 -07:00
completion_extras fix(router): classify encrypted delegated tasks with native Responses 2026-09-10 12:32:09 -07:00
compression refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
containers Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r4 2026-09-02 23:32:10 +00:00
endpoints/speech/speech_to_completion_bridge refactor(speech): freeze httpx response header dicts (LIT002) 2026-08-31 21:12:53 -07:00
evals
experimental_mcp_client chore: merge current staging for MCP diagnostic compatibility 2026-09-11 07:01:06 -07:00
files test(batches): use immutable expectations with explicit test doubles 2026-09-07 16:36:27 -07:00
fine_tuning refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
google_genai refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
images refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
integrations Merge pull request #39516 from BerriAI/litellm_vector_store_surface_retrieval_failure 2026-09-11 11:46:42 -07:00
interactions refactor(typing): replace Any with proven types in 42 more backend files 2026-09-02 15:35:01 +00:00
litellm_core_utils feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
llms Merge pull request #39507 from BerriAI/litellm_fix_oci_streaming_chunk_ids 2026-09-11 11:46:35 -07:00
models feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
ocr test(ocr): add SDK callback E2E parity (#40061) 2026-09-07 11:23:12 -07:00
passthrough fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response (#40724) 2026-09-11 09:53:37 -07:00
proxy fix(mcp): write failure spend log for guardrail-blocked /mcp-rest/tools/call (#40555) 2026-09-11 12:54:03 -07:00
proxy_auth
rag chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
realtime_api Merge pull request #39851 from BerriAI/litellm_fix_realtime_backend_close_hang 2026-09-05 09:51:15 -07:00
repositories feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
rerank_api fix(rerank): adopt declared authenticating providers in arerank instead of resolving them 2026-09-01 14:47:59 -07:00
responses fix(router): honor Codex reminders and map classifier failures 2026-09-10 13:48:21 -07:00
router_strategy fix(router): fall back from unhealthy auto-router tier (#40757) 2026-09-11 11:51:55 -07:00
router_utils docs(router): name both affinity TTL knobs in the _claim_pin docstring (#40663) 2026-09-11 10:22:32 -07:00
rust_bridge feat(rust_bridge): count budget-check input tokens in Rust on all LLM routes (#40381) 2026-09-10 13:56:30 -07:00
sandbox
search fix(search): forward search-tool params through the router, complete Parallel AI v1 param mapping (#37883) 2026-09-01 21:46:46 -07:00
secret_managers feat(secret_managers): support customer-managed KMS key for virtual keys stored in AWS Secrets Manager (#40475) 2026-09-11 09:54:08 -07:00
skills feat(skills): semantic search over the LiteLLM-hosted skill registry (#39401) 2026-09-07 12:28:38 -07:00
types feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
vector_store_files refactor(typing): replace Any with proven types in 42 more backend files 2026-09-02 15:35:01 +00:00
vector_stores Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_python_version_ci 2026-09-03 00:16:19 -07:00
videos
__init__.py Merge pull request #39516 from BerriAI/litellm_vector_store_surface_retrieval_failure 2026-09-11 11:46:42 -07:00
_internal_context.py fix(proxy): price one cost estimate at one moment 2026-09-07 18:38:12 -07:00
_lazy_imports.py fix(lazy_imports): type import_map as Mapping to stay under the LIT001 budget 2026-09-05 16:12:45 -07:00
_lazy_imports_registry.py Revert "perf: lazy-load SDK symbols so import litellm stays under 60 MB RSS (…" 2026-09-05 16:07:09 -07:00
_logging.py fix(proxy): stop leaking internal exception details to clients (#39380) 2026-09-02 17:32:00 -07:00
_redis.py fix(redis): accept every truthy flag and sign serverless ElastiCache caches 2026-09-10 10:13:03 -04:00
_redis_credential_provider.py fix(redis): accept every truthy flag and sign serverless ElastiCache caches 2026-09-10 10:13:03 -04:00
_service_logger.py chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
_uuid.py
_version.py
anthropic_beta_headers_config.json
anthropic_beta_headers_manager.py
blog_posts.json
budget_manager.py
constants.py fix(proxy): keep call_type and request start time on failed-request spend logs (#40558) 2026-09-11 12:22:18 -07:00
cost.json
cost_calculator.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_cost_estimate_cache_tokens 2026-09-09 10:05:48 -07:00
exceptions.py Merge pull request #39516 from BerriAI/litellm_vector_store_surface_retrieval_failure 2026-09-11 11:46:42 -07:00
main.py fix(streaming): keep admitted mock streams alive with empty stream_options and honor zero prompt counts (#40650) 2026-09-10 18:37:39 -07:00
model_prices_and_context_window_backup.json registry audit 2026-09-11: xai/groq deprecation dates, deepseek-v4-flash vision, perplexity nemotron reasoning 2026-09-11 13:14:37 +00:00
policy_templates_backup.json
provider_endpoints_support_backup.json fix(ocr): send each provider a health-check document it accepts 2026-09-04 22:52:12 -07:00
py.typed
router.py fix(router): fall back from unhealthy auto-router tier (#40757) 2026-09-11 11:51:55 -07:00
scheduler.py
setup_wizard.py feat(models): add Claude Fable 5.1 across Anthropic, Bedrock, Vertex AI, and Azure AI 2026-09-01 18:07:06 +00:00
timeout.py
utils.py fix(logging): finish response metadata before the sync logging thread reads it (#39869) 2026-09-10 18:15:24 -07:00