Clean up TTFB metrics and previous_response state on inference failure

This commit is contained in:
Paul Kompfner
2026-03-30 23:04:06 -04:00
parent f19d1183d8
commit ab9f2a35b6

View File

@@ -783,6 +783,10 @@ class OpenAIResponsesLLMService(_BaseOpenAIResponsesLLMService, WebsocketLLMServ
)
self._clear_previous_response_state()
await self.stop_ttfb_metrics()
except Exception:
self._clear_previous_response_state()
await self.stop_ttfb_metrics()
raise
# -- retry with full context (no optimization) ------------------------