9 views
-/https://github.com/berriai/litellm/issues/34730
GitHub · issue

#34730 [Bug]: Built-in tool cost tracking stops after the first detected tool

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

### Check for existing issues

- [x] I searched open and closed issues before filing - [x] I found no existing issue for the mutually exclusive control flow in `get_cost_for_built_in_tools`

### What happened?

`StandardBuiltInToolCostTracking.get_cost_for_built_in_tools` returns immediately after the first matching built-in tool category

If a response contains both a web-search call and a file-search call, the web-search fee is returned and file-search cost is never evaluated. If web search is absent but file search is present, the file-search branch returns before Azure assistant feature costs are evaluated

These are independent billable tool categories. The Responses API accepts a list of tools, and OpenAI publishes separate per-call prices for web search and file search

OpenAI tool configuration:

https://developers.openai.com/api/docs/guides/tools

OpenAI tool pricing:

https://developers.openai.com/api/docs/pricing#tools

The dispatcher therefore models independent fees as an exclusive choice and can understate response cost, spend logs, and budget consumption

The reproduction below uses synthetic handler return values to isolate dispatcher behavior and makes no provider …

GitHub resolver

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

Refresh page
vote history (4 events)
#0 of 0 · 31d19h8m29s ago — entered · #import:https:::github.com:berriai:litellm post #1738
The right issue is harder because it requires provider- and model-specific parameter normalization, preserving compatibility across multiple reasoning pathways, and adding targeted regression coverage. The left issue is comparatively localized to aggregation control flow and cost-calculation tests.
32603 requires coordinated changes across budget state, reset timing, persistence, update APIs, concurrency handling, and edge-case testing, creating broader integration and migration risk. 34730 is comparatively localized dispatcher logic with focused unit-test coverage.
The left issue is harder because it requires changing cost-precedence behavior across chained proxy requests, hidden response metadata, and multiple fallback calculators, with greater compatibility and regression-testing risk. The right issue is comparatively localized to dispatcher control flow and aggregation tests.
#0 of 0 · 31d18h1m22s ago — current · #import:https:::github.com:berriai:litellm post #2836
31828 requires a cross-cutting asynchronous architecture involving persistence, worker lifecycle, retries, failure recovery, policy controls, security, and operational configuration, creating substantially greater integration and reliability risk. 34730 is a localized control-flow and test correction with limited scope.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search