Files
crewAI/lib
alex-clawd b890ac0dd0 fix: use __router_paths__ for listener+router methods in FlowMeta (#5064)
When a method has both @listen and @human_feedback(emit=[...]),
the FlowMeta metaclass registered it as a router but only used
get_possible_return_constants() to detect paths. This fails for
@human_feedback methods since the paths come from the decorator's
emit param, not from return statements in the source code.

Now checks __router_paths__ first (set by @human_feedback), then
falls back to source code analysis for plain @router methods.

This was causing missing edges in the flow serializer output —
e.g. the whitepaper generator's review_infographic -> handle_cancelled,
send_slack_notification, classify_feedback edges were all missing.

Adds test: @listen + @human_feedback(emit=[...]) generates correct
router edges in serialized output.

Co-authored-by: Joao Moura <joao@crewai.com>
2026-03-25 03:42:39 -03:00
..