refactor(hooks): name the soft turn-limit warning after the soft limit

This commit is contained in:
Ian 2026-10-23 17:08:10 -04:00 • committed by Ahmed Allam
parent b8d586a39b
commit f46bed6740

View file

@ -220,7 +220,7 @@ class ReportUsageHooks(RunHooks[dict[str, Any]]):
context.context[LLM_TURN_KEY] = int(context.context.get(LLM_TURN_KEY, 0)) + 1
try:
self._maybe_warn_turns(context, input_items)
self._maybe_warn_turn_limit(context, input_items)
self._maybe_warn_soft_turn_limit(context, input_items)
self._maybe_warn_budget(context, input_items)
except Exception:
logger.exception("budget/turn warning injection failed")
@ -284,7 +284,7 @@ class ReportUsageHooks(RunHooks[dict[str, Any]]):
)
input_items.append({"role": "user", "content": content})
def _maybe_warn_turn_limit(
def _maybe_warn_soft_turn_limit(
self,
context: RunContextWrapper[dict[str, Any]],
input_items: list[TResponseInputItem],