step_callbackTier 1 · 70% confidence

ai-agents-step-callback-step-callback-is-defined-in-crew-or-agent-but-neve-41f5fc62

agent: ai_agents

When does this happen?

IF step_callback is defined in Crew or Agent but never invoked during task execution.

How others solved it

THEN Move the step_callback invocation outside the conditional that only runs when a tool is used. In crew_agent_executor.py, lines 148-166, the callback call should be executed after every agent step, not only within the tool-using branch. This ensures callback fires for both tool and non-tool agent steps.

# Fix: in crew_agent_executor.py, indent the callback call outside the 'if tool' block
# Before (inside tool block):
#   if tool:
#       ...
#       step_callback(step_output)
# After:
#   if tool:
#       ...
#   step_callback(step_output)  # always called

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics