Skip to content

refactor: clean up fresh tech debt from 2026-09-30 - #43993

Merged
mateo-berri merged 4 commits into
mainfrom
litellm_techdebt_20261001
Oct 1, 2026
Merged

mateo-berri merged 4 commits into
mainfrom
litellm_techdebt_20261001

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Fresh tech debt merged to main on 2026-09-30
  • Two dead functions and six slop or redundant comment lines

How it solves it:

  • Deletes each at the line it landed on, 43 lines removed in total
  • No behavior change: nothing called the functions, the rest are comments

User Flow

Before: a proxy admin ingests agent traces and checks the ROI calculator, and everything answers

  1. They POST https://litellm-domain/v1/traces with an OTLP JSON export and get 200 {}
  2. GET https://litellm-domain/v1/traces lists the trace, and GET /v1/traces/<trace_id> returns its six spans
  3. They connect GitHub in ROI settings, start a sync with POST https://litellm-domain/roi-calculator/sync, and it finishes with every merged PR estimated

After: the same admin sees exactly the same answers, since only unused code and comments are gone

  1. They POST https://litellm-domain/v1/traces with an OTLP JSON export and get 200 {}
  2. GET https://litellm-domain/v1/traces lists the trace, and GET /v1/traces/<trace_id> returns its six spans
  3. They connect GitHub in ROI settings, start a sync with POST https://litellm-domain/roi-calculator/sync, and it finishes with every merged PR estimated

Findings (run of 2026-10-01, window 2026-09-30)

  1. 6b9766fa0c feat(proxy): add native ROI calculator for gateway spend vs merged PRs (feat(proxy): add native ROI calculator for gateway spend vs merged PRs #43669). current_cache_context in roi_calculator/pull_cache.py was a one-line wrapper over estimator.cache_context with no caller in litellm/, enterprise/, or tests/. Deleted along with the import it alone used
  2. 6b9766fa0c (feat(proxy): add native ROI calculator for gateway spend vs merged PRs #43669). pull_cache_key in roi_calculator/estimator.py had no caller anywhere; the sync path keys pulls with pull_cache.cache_key instead. Deleted, every helper it used still has other callers
  3. 268eb4d6e6 feat(tracing): add OTLP trace ingestion and reads (feat(tracing): port OTLP ingestion to current trace foundation #43915). Four ASCII section banners (# ---- decode, # ---- normalize, # ---- write, # ---- read) in tracing/decode.py and tracing/receiver.py. Deleted
  4. 268eb4d6e6 (feat(tracing): port OTLP ingestion to current trace foundation #43915). The # Agent tracing / ClickHouse section header in constants.py restated the constant names below it. Deleted
  5. 268eb4d6e6 (feat(tracing): port OTLP ingestion to current trace foundation #43915), made stale by 6fd9334751 feat(lens): analyze agent activity with a separate worker (feat(lens): analyze agent activity with a separate worker #43889). The # agent tracing: OTLP ingest + reads (scoped to the caller's team in the handler) comment in LiteLLMRoutes now sits above the unrelated /engine routes. Deleted rather than moved: the team scoping it mentions is documented in the tracing_endpoints.py handler docstring and enforced there, so the route list does not need it. The list itself is unchanged

Deliberately left alone

Screenshots / Proof of Fix

Parity A/B, since this PR must not change behavior: the same 14 requests sent to a live proxy at the merge base and at the tip, each leg booted from its own worktree (litellm.__file__ asserted inside it) with --num_workers 2, its own Postgres database and its own ClickHouse database, general_settings.tracing.store: clickhouse, real openai/gpt-4o-mini calls, and real GitHub. Both legs logged Agent tracing enabled (store=clickhouse) on both workers before traffic. The trace payload is tests/test_litellm/tracing/fixtures/langsmith_deep_agent_export.json, a real LangSmith OTLP export. The ROI leg connects GitHub, selects BerriAI/litellm-docs, picks gpt-4o-mini as estimator, starts a sync with POST /roi-calculator/sync, polls it to completion, and reads the report, which drives estimator.py and pull_cache.py end to end. Volatile fields (completion id and text, timestamps, durations) are masked and each body is cut at 400 characters

Before (0980f75)

Every request answers as expected: chat 200, OTLP ingest 200 {}, the trace lists with 6 spans, ROI settings save, the sync returns 202 and finishes phase=complete with done=8/8, estimated=8, needs_attention=0, error=null, the report returns 200, and /engine returns {"engines":[],"workers":[],"tracing_enabled":true}

Raw commands and masked output, base
== leg base at 0980f756bd, 2 uvicorn workers, Postgres + ClickHouse
$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' -X POST -H 'Content-Type: application/json' --data '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"say ok"}],"max_tokens":5}' "http://127.0.0.1:39391/v1/chat/completions" -w '\n%{http_code}'
status=200
body={"id":"<completion-id>","created":"<volatile>","model":"gpt-4o-mini","object":"chat.completion","system_fingerprint":"<volatile>","choices":[{"finish_reason":"stop","index":0,"message":{"content":"<completion-text>","role":"assistant","provider_specific_fields":{"refusal":null},"annotations":[]},"provider_specific_fields":{}}],"usage":{"completion_tokens":2,"prompt_tokens":9,"total_tokens":11,"com

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' -H 'Content-Type: application/json' --data-binary "@/home/ubuntu/repos/litellm/tests/test_litellm/tracing/fixtures/langsmith_deep_agent_export.json" "http://127.0.0.1:39391/v1/traces" -w '\n%{http_code}'
status=200
body={}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/v1/traces?start_ms=1790640000000&end_ms=1790900000000" -w '\n%{http_code}'
status=200
body={"data":[{"trace_id":"4bad42b84e9de3ba46fc870185f8f023","trace_ref":"D1F5AE5D1A5509D1D5FF5B4C57111BBE22CF9388E0BBA0309EC415C73C0AAA41","name":"deep_research_agent","service":"agent-demo","input_preview":"[{\"role\": \"user\", \"content\": \"Should we store OTEL agent spans in ClickHouse or Postgres at 50k spans/sec?\"}]","start_time":"<volatile>","duration_ms":"<volatile>","status":"ok","span_coun

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/v1/traces/4bad42b84e9de3ba46fc870185f8f023" -w '\n%{http_code}'
status=200
body={"summary":{"trace_id":"4bad42b84e9de3ba46fc870185f8f023","trace_ref":"","name":"deep_research_agent","service":"agent-demo","input_preview":"[{\"role\": \"user\", \"content\": \"Should we store OTEL agent spans in ClickHouse or Postgres at 50k spans/sec?\"}]","start_time":"<volatile>","duration_ms":"<volatile>","status":"ok","span_count":6,"agent_count":2,"agent_invocations":2,"llm_calls":1,"tool

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/v1/traces/4bad42b84e9de3ba46fc870185f8f023/spans/5e79f3b5b504985e" -w '\n%{http_code}'
status=200
body={"span_id":"5e79f3b5b504985e","input":"[{\"role\": \"user\", \"content\": \"Should we store OTEL agent spans in ClickHouse or Postgres at 50k spans/sec?\"}]","output":"{\"role\": \"assistant\", \"content\": \"Based on the research findings, here's my recommendation:\\n\\n## Recommendation: **Use ClickHouse**\\n\\n**ClickHouse is the clear choice** for storing 50k OTEL spans/...\"}","attributes":{"

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/settings" -w '\n%{http_code}'
status=200
body={"github_api_url":"https://api.github.com","repos":[],"estimator_model":"","estimator_prompt":"Estimate how many hours it would take an engineer to complete the work in this pull request without AI assistance. Explain your estimate briefly.","backfill_days":7,"update_interval_minutes":1440,"has_estimator_key":false,"identity_map":{},"has_github_token":false,"default_prompt":"Estimate how many hour

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":false,"phase":"idle","stage":"Idle","done":0,"total":0,"estimated":0,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' -X PUT -H 'Content-Type: application/json' --data '{"github_token":"$LITELLM_OPS_GITHUB_PAT","repos":["BerriAI/litellm-docs"],"estimator_model":"gpt-4o-mini","backfill_days":1}' "http://127.0.0.1:39391/roi-calculator/settings" -w '\n%{http_code}'
status=200
body={"github_api_url":"https://api.github.com","repos":["BerriAI/litellm-docs"],"estimator_model":"gpt-4o-mini","estimator_prompt":"Estimate how many hours it would take an engineer to complete the work in this pull request without AI assistance. Explain your estimate briefly.","backfill_days":1,"update_interval_minutes":1440,"has_estimator_key":false,"identity_map":{},"has_github_token":true,"default

$ curl -sS --max-time 120 -X POST -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/sync" -w '\n%{http_code}'
status=202
body={"running":true,"phase":"spend","stage":"Reading gateway spend","done":0,"total":0,"estimated":0,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":true,"phase":"spend","stage":"Reading gateway spend","done":0,"total":0,"estimated":0,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":true,"phase":"estimates","stage":"Estimating new or changed pull requests","done":3,"total":8,"estimated":3,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":false,"phase":"complete","stage":"Analysis complete","done":8,"total":8,"estimated":8,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

ROI sync final fields: {"running":false,"phase":"complete","stage":"Analysis complete","done":8,"total":8,"estimated":8,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/roi-calculator/report" -w '\n%{http_code}'
status=200
body={"top_level_keys":["report"],"array_counts":[{"path":"report.repos","count":1},{"path":"report.warnings","count":0},{"path":"report.people","count":6},{"path":"report.people.0.logins","count":1},{"path":"report.people.0.match_methods","count":1},{"path":"report.people.1.logins","count":1},{"path":"report.people.1.match_methods","count":1},{"path":"report.people.2.logins","count":1},{"path":"report

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:39391/engine" -w '\n%{http_code}'
status=200
body={"engines":[],"workers":[],"tracing_enabled":true}

After (ea2d141)

The same 14 requests give the same statuses and bodies: the sync finishes phase=complete with done=8/8, estimated=8, needs_attention=0, error=null, and both legs write the same 8 roi_calculator_pull_<cache_key> rows to Postgres, so pull_cache.cache_key is unchanged

Raw commands and masked output, head
== leg head at ea2d1410e5, 2 uvicorn workers, Postgres + ClickHouse
$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' -X POST -H 'Content-Type: application/json' --data '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"say ok"}],"max_tokens":5}' "http://127.0.0.1:40201/v1/chat/completions" -w '\n%{http_code}'
status=200
body={"id":"<completion-id>","created":"<volatile>","model":"gpt-4o-mini","object":"chat.completion","system_fingerprint":"<volatile>","choices":[{"finish_reason":"stop","index":0,"message":{"content":"<completion-text>","role":"assistant","provider_specific_fields":{"refusal":null},"annotations":[]},"provider_specific_fields":{}}],"usage":{"completion_tokens":2,"prompt_tokens":9,"total_tokens":11,"com

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' -H 'Content-Type: application/json' --data-binary "@/home/ubuntu/repos/litellm/tests/test_litellm/tracing/fixtures/langsmith_deep_agent_export.json" "http://127.0.0.1:40201/v1/traces" -w '\n%{http_code}'
status=200
body={}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/v1/traces?start_ms=1790640000000&end_ms=1790900000000" -w '\n%{http_code}'
status=200
body={"data":[{"trace_id":"4bad42b84e9de3ba46fc870185f8f023","trace_ref":"D1F5AE5D1A5509D1D5FF5B4C57111BBE22CF9388E0BBA0309EC415C73C0AAA41","name":"deep_research_agent","service":"agent-demo","input_preview":"[{\"role\": \"user\", \"content\": \"Should we store OTEL agent spans in ClickHouse or Postgres at 50k spans/sec?\"}]","start_time":"<volatile>","duration_ms":"<volatile>","status":"ok","span_coun

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/v1/traces/4bad42b84e9de3ba46fc870185f8f023" -w '\n%{http_code}'
status=200
body={"summary":{"trace_id":"4bad42b84e9de3ba46fc870185f8f023","trace_ref":"","name":"deep_research_agent","service":"agent-demo","input_preview":"[{\"role\": \"user\", \"content\": \"Should we store OTEL agent spans in ClickHouse or Postgres at 50k spans/sec?\"}]","start_time":"<volatile>","duration_ms":"<volatile>","status":"ok","span_count":6,"agent_count":2,"agent_invocations":2,"llm_calls":1,"tool

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/v1/traces/4bad42b84e9de3ba46fc870185f8f023/spans/5e79f3b5b504985e" -w '\n%{http_code}'
status=200
body={"span_id":"5e79f3b5b504985e","input":"[{\"role\": \"user\", \"content\": \"Should we store OTEL agent spans in ClickHouse or Postgres at 50k spans/sec?\"}]","output":"{\"role\": \"assistant\", \"content\": \"Based on the research findings, here's my recommendation:\\n\\n## Recommendation: **Use ClickHouse**\\n\\n**ClickHouse is the clear choice** for storing 50k OTEL spans/...\"}","attributes":{"

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/settings" -w '\n%{http_code}'
status=200
body={"github_api_url":"https://api.github.com","repos":[],"estimator_model":"","estimator_prompt":"Estimate how many hours it would take an engineer to complete the work in this pull request without AI assistance. Explain your estimate briefly.","backfill_days":7,"update_interval_minutes":1440,"has_estimator_key":false,"identity_map":{},"has_github_token":false,"default_prompt":"Estimate how many hour

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":false,"phase":"idle","stage":"Idle","done":0,"total":0,"estimated":0,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' -X PUT -H 'Content-Type: application/json' --data '{"github_token":"$LITELLM_OPS_GITHUB_PAT","repos":["BerriAI/litellm-docs"],"estimator_model":"gpt-4o-mini","backfill_days":1}' "http://127.0.0.1:40201/roi-calculator/settings" -w '\n%{http_code}'
status=200
body={"github_api_url":"https://api.github.com","repos":["BerriAI/litellm-docs"],"estimator_model":"gpt-4o-mini","estimator_prompt":"Estimate how many hours it would take an engineer to complete the work in this pull request without AI assistance. Explain your estimate briefly.","backfill_days":1,"update_interval_minutes":1440,"has_estimator_key":false,"identity_map":{},"has_github_token":true,"default

$ curl -sS --max-time 120 -X POST -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/sync" -w '\n%{http_code}'
status=202
body={"running":true,"phase":"spend","stage":"Reading gateway spend","done":0,"total":0,"estimated":0,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":true,"phase":"spend","stage":"Reading gateway spend","done":0,"total":0,"estimated":0,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":true,"phase":"estimates","stage":"Estimating new or changed pull requests","done":3,"total":8,"estimated":3,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/sync" -w '\n%{http_code}'
status=200
body={"running":false,"phase":"complete","stage":"Analysis complete","done":8,"total":8,"estimated":8,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

ROI sync final fields: {"running":false,"phase":"complete","stage":"Analysis complete","done":8,"total":8,"estimated":8,"reused":0,"needs_attention":0,"error":null,"started_at":"<volatile>","finished_at":"<volatile>","next_update":"<volatile>","elapsed_seconds":"<volatile>","remaining_seconds":"<volatile>"}

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/roi-calculator/report" -w '\n%{http_code}'
status=200
body={"top_level_keys":["report"],"array_counts":[{"path":"report.repos","count":1},{"path":"report.warnings","count":0},{"path":"report.people","count":6},{"path":"report.people.0.logins","count":1},{"path":"report.people.0.match_methods","count":1},{"path":"report.people.1.logins","count":1},{"path":"report.people.1.match_methods","count":1},{"path":"report.people.2.logins","count":1},{"path":"report

$ curl -sS --max-time 120 -H 'Authorization: Bearer $LITELLM_MASTER_KEY' "http://127.0.0.1:40201/engine" -w '\n%{http_code}'
status=200
body={"engines":[],"workers":[],"tracing_enabled":true}

Both legs ran on freshly created Postgres and ClickHouse databases. Diffing the two transcripts leaves only the leg header and the proxy port, with every status, trace id, span count, sync counter, report count, and /engine body identical. Both databases end with the same 8 roi_calculator_pull_<cache_key> rows, so the surviving pull_cache.cache_key produced identical keys at base and tip. Comparing the full stored roi_calculator_report values, the only differences are synced_at and one PR estimated at 3.0 hours on base and 2.0 on head, which is gpt-4o-mini output, not code

roi_calculator_pull rows, identical on both legs
roi_calculator_pull_40a372f9370eb6ff41246791e5c8970caa32610f4a447948324a3271e552ac87
roi_calculator_pull_44367620b07e9f8d19becda6b7046df7b5231eb81b54205b67b05af629c61ee5
roi_calculator_pull_5368849e958a5bd6c0623b900226fadb3b6e1054d9e72787b60aad4780e8e89c
roi_calculator_pull_9619f0bfb57cfff1557d41f92bc53f9f1f4f6a5424ce04b822ab3f3f4278b7d3
roi_calculator_pull_a3e77a3bbb041af20ecf29c15f1c2937d8727d5c57ba5f353314a744467eb3f5
roi_calculator_pull_b7a48d74a9553dfee5a3e6e09edbc5895d972a7ef8ac71016bdc80f7e2452a1f
roi_calculator_pull_f62d9d2264f051251987ee9d352e76fc675cb3e073456555b429ae096093b1e4
roi_calculator_pull_f6716e9df3f93a04eefaa230795e033f413291f8be26e5525c3645f626509b3d

Live PR risk

Ran /live-pr-risk and found no regressions/backward incompatible risks. The only removed symbols are pull_cache_key and current_cache_context; a sweep of litellm/, enterprise/, tests/, ui/, litellm-docs, and the sibling repos finds no reference, string or otherwise, and neither module defines __all__. Every other hunk is a comment. The live paths that reach the edited modules (OTLP ingest, trace list, trace and span reads, ROI settings, a full ROI sync, and the ROI report) were driven in the A/B above with matching results

Audit

Ran /audit at base 0980f756bd and head ea2d1410e5. Surface inventory: the four files constants.py, _types.py, tracing/decode.py, and tracing/receiver.py parse to an identical AST at base and head (ast.dump equality), so they have no runtime surface. In estimator.py and pull_cache.py every surviving top-level node is AST-identical and the only removed nodes are pull_cache_key, current_cache_context, and the import only the latter used, so the inventory is the ROI sync path that imports both modules plus any consumer of the removed names, of which there is none

Row Cell Base Head run 1 Head run 2
ROI pull cache and sync state persist through the writer tests/integration/database/test_roi_sync_store.py::test_roi_cache_survives_scope_changes_and_uses_writer PASS PASS PASS
Full ROI sync against real GitHub and real gpt-4o-mini live cell, A/B above, 8 of 8 PRs estimated, identical pull cache keys PASS PASS
OTLP ingest and trace reads on ClickHouse live cell, A/B above, identical trace ids and span counts PASS PASS

Head runs collected and passed the same node id with seed 4106601, no skips or retries. No new integration test was added: no surviving line changed, and the cleanup run forbids speculative tests

Caveats (if any)

Low

  • No before=fail and after=succeed proof is possible, so a parity A/B stands in for it
    • Nothing an end user can observe changes: two unreferenced functions and six comment lines are deleted
    • The A/B is driven with curl, not the Admin UI ROI settings page
    • Raw bodies are cut at 400 characters; the full stored reports were compared separately
  • proxy-behavior is red only because Codecov could not verify its CLI signature after 929 tests passed; the merge base 0980f756bd fails the same step (job 110240402606) and it is not a required check
  • oauth waits on the e2e-changed environment approval, which applies only to PRs touching tests/e2e/; this PR does not and it is not a required check
  • Deleting pull_cache_key drops the only key that covered diff evidence (files, commits, line counts)
    • The live pull_cache.cache_key keys on head_sha, title, body, and login, and is unchanged
    • Wiring the deleted key in would change cache behavior, which belongs in a feature PR, not this cleanup

Type

Refactoring

Pre-Submission checklist

  • I have added meaningful tests (none needed: the change deletes only unused code and comments)
  • The handful of test files covering my change pass locally: tests/unit/proxy/roi_calculator, tests/unit/proxy/management_endpoints/test_roi_calculator_endpoints.py, tests/test_litellm/tracing, tests/test_litellm/proxy/test_tracing_endpoints.py
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/5de075df67d943c4aa29c8af73840e74
Open in Devin Desktop: https://app.devin.ai/desktop/session/5de075df67d943c4aa29c8af73840e74?variant=devin


Note

Low Risk
Comment-only edits plus deletion of symbols with no callers in the repo; OTLP ingest and ROI endpoints were A/B verified unchanged.

Overview
Removes 43 lines of unused code and comment noise from recent agent-tracing and ROI calculator work, with no intended behavior change.

ROI calculator: Deletes pull_cache_key in estimator.py and current_cache_context in pull_cache.py (plus its cache_context import). Sync still keys pulls via pull_cache.cache_key; cache_context remains in use on the sync path.

Tracing / proxy: Strips section-banner comments in tracing/decode.py and tracing/receiver.py, the redundant ClickHouse header in constants.py, and a stale OTLP route comment in _types.py that no longer matched the /engine routes below it.

Reviewed by Cursor Bugbot for commit ea2d141. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from a team October 1, 2026 07:56
@devin-ai-integration

devin-ai-integration Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Removes unused code and comment separators.

The PR appears safe to merge; no outstanding finding or new actionable issue was identified.

Summary

The PR removes two unused ROI calculator helpers and stale or redundant comments. The route list and remaining tracing and ROI calculator logic are unchanged.

Reviews (5) · Last reviewed commit: "refactor: drop route comment that duplic..."

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_techdebt_20261001 (ea2d141) with main (0980f75)

Open in CodSpeed

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

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

Copy link
Copy Markdown
Contributor

@greptileai

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

Copy link
Copy Markdown
Contributor

@greptileai

Comment thread litellm/proxy/_types.py Outdated
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ea2d141. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mateo-berri
mateo-berri merged commit 5107f20 into main Oct 1, 2026
102 of 104 checks passed
@mateo-berri
mateo-berri deleted the litellm_techdebt_20261001 branch October 1, 2026 11:47

This branch is waiting to be deployed

1 waiting deployment
e2e-changed — ea2d1410 Waiting Oct 1, 2026 by devin-ai-integration[bot] via oauth #2298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants