6 views
-/https://github.com/berriai/litellm/issues/27840
GitHub ยท issue

#27840 [Bug]: Tool registry (LiteLLM_ToolTable / LiteLLM_SpendLogToolIndex) not populated for /v1/messages (anthropic_messages) path

  • State: open
  • Author: @lgrossi
  • Labels: llm translation

## Description

`LiteLLM_ToolTable` and `LiteLLM_SpendLogToolIndex` stay empty for all traffic going through the `/v1/messages` endpoint (the native Anthropic messages API path, `route_type="anthropic_messages"`).

## Root Cause

`_enqueue_tool_registry_upsert` in `litellm/proxy/db/db_spend_update_writer.py` handles four sources for tool names, but misses the non-passthrough `anthropic_messages` path:

1. MCP tool calls via `standard_logging_object.metadata.mcp_tool_call_metadata` โœ… 2. Request tools in OpenAI format (`kwargs["tools"][].function.name`) โœ… 3. Request tools in Anthropic pass-through format (`kwargs["passthrough_logging_payload"]["request_body"]["tools"][].name`) โœ… 4. Response tool calls (`completion_response.choices[].message.tool_calls`) โœ…

The gap: when a request is routed through `anthropic_messages` (i.e. `llm_router.anthropic_messages(**data)`), the response is an `AnthropicMessagesResponse` โ€” a plain `TypedDict` with `content[{"type": "tool_use", "name": ..., "input": {...}}]`. This shape is never inspected by `_enqueue_tool_registry_upsert`. The `hasattr(completion_response, "choices")` guard on path 4 is `False` for a dict, so response tool calls are silently dโ€ฆ

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 ยท 31d18h39m4s ago โ€” entered ยท #import:https:::github.com:berriai:litellm post #2208
Issue 31835 is substantially harder because it spans new administrative workflows, historical data processing, pricing-version selection, configurable billing semantics, repeatability, auditing, and safety across persistence and proxy behavior. Issue 27840 is a localized response-shape handling gap with focused code and test changes.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search