fix: resolve human input result display - #7237
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesHuman input visibility
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Human-review runs now display the final result regardless of verbosity in both executor paths, with regression coverage for each implementation. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description includes the related issue, solution summary, verification checklist, test coverage, and test command. The optional Additional context section is omitted, but the description is otherwise complete. Full details: Linked Issues checkExplanation The changes satisfy issue ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
VANDRANKI
left a comment
There was a problem hiding this comment.
Community review, not a merge gate.
Small, focused fix touching two parallel executors: crewai/agents/crew_agent_executor.py's _show_logs and crewai/experimental/agent_executor.py's _show_logs (the legacy and newer executor implementations). Both previously computed the AgentLogsExecutionEvent's verbose flag as agent.verbose or crew.verbose only. This PR adds or self.ask_for_human_input (legacy) / or self.state.ask_for_human_input (experimental) to that condition.
The behavior change makes sense given the surrounding context: this event is what actually prints the agent's answer to the terminal, and it fires right before the human-input flow asks the user for feedback on that same answer. With verbose off and no human-input flag, a user asked "do you want to give feedback on this?" would have no way to see what they're being asked to review. Gating visibility on ask_for_human_input as well as verbose fixes a real UX gap, not just a style change.
Both executors get matching test coverage (test_show_logs_is_visible_when_human_input_requested for the experimental one via _build_executor, test_legacy_show_logs_is_visible_when_human_input_requested for the legacy one via CrewAgentExecutor.model_construct), each setting agent.verbose=False and crew.verbose=False explicitly and asserting event.verbose is True once the human-input flag is set. That isolates the new condition rather than just re-testing the pre-existing or-chain.
What I didn't verify: I read only this diff's two functions, not the rest of either executor class, so I'm taking on faith that self.ask_for_human_input (legacy) and self.state.ask_for_human_input (experimental) are the actual live fields the rest of each class's human-input flow sets, rather than confirming that by reading where they're assigned elsewhere in these files.
Related issue
Fixes #6072
Summary
When
human_input=Trueis set on a task, CrewAI asks the operator to review the final answer. Previously, if both the agent and crew were running withverbose=False, the feedback prompt appeared but the final answer panel was hidden.This updates both executor paths so the final answer is shown when human input is pending, even if normal verbose logging is disabled. Non-verbose runs without human review remain quiet.
Verification
Added regression coverage for:
AgentExecutorCrewAgentExecutorRan: