style: shorten the tool-call guard comment

This commit is contained in:
Lucas Gomide
2026-07-13 17:29:27 -03:00
parent 3bdd042314
commit e1afb7ad71

View File

@@ -1751,11 +1751,9 @@ def _setup_after_llm_call_hooks(
if executor_context and executor_context.after_llm_call_hooks:
from crewai.hooks.llm_hooks import LLMCallHookContext
# Structured tool-call payloads are not a textual response yet, so the
# response-rewrite pass below would stringify them and the executor
# would treat the result as a final answer instead of executing the
# tools. Mirror _invoke_after_llm_call_hooks' isinstance guard and pass
# them through untouched; hooks fire on the follow-up textual response.
# Don't stringify structured tool-call payloads: the executor would
# treat the result as a final answer and skip tool execution (#6529).
# Hooks still run on the follow-up textual response.
if not isinstance(answer, (str, BaseModel)):
return answer