fix: remove start_time from self.data to avoid snapshot test pollution

start_time was not needed for overhead computation on non-chat routes
because llm_api_duration_ms is also not available. Use end_time for
both start and end; the guard prevents affecting chat completions.

Fixes #30566
This commit is contained in:
factnn 2026-06-18 18:44:02 +08:00
parent 54e95af071
commit 742e0feb12

View file

@ -1366,8 +1366,6 @@ class ProxyBaseLLMRequestProcessing:
llm_router=llm_router,
)
self.data["start_time"] = datetime.now()
# Defer async logging when post-call guardrails are configured so the
# StandardLoggingPayload is built after guardrails write to metadata.
# Cache the result to avoid scanning litellm.callbacks twice.
@ -1442,7 +1440,7 @@ class ProxyBaseLLMRequestProcessing:
logging_obj=self.data.get("litellm_logging_obj"),
model=self.data.get("model"),
kwargs=self.data,
start_time=self.data.get("start_time", end_time),
start_time=end_time,
end_time=end_time,
)