mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-10 21:12:37 +00:00
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>