Skip to content

fix: resolve human input result display - #7237

Open
HamdanS12346 wants to merge 1 commit into
crewAIInc:mainfrom
HamdanS12346:fix/6072-human-input
Open

fix: resolve human input result display#7237
HamdanS12346 wants to merge 1 commit into
crewAIInc:mainfrom
HamdanS12346:fix/6072-human-input

Conversation

@HamdanS12346

Copy link
Copy Markdown

Related issue

Fixes #6072

Summary

When human_input=True is set on a task, CrewAI asks the operator to review the final answer. Previously, if both the agent and crew were running with verbose=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

  • Tests added or updated for the changed behavior
  • Relevant tests and quality checks pass locally

Added regression coverage for:

  • Default AgentExecutor
  • Legacy CrewAgentExecutor

Ran:

.\.venv\Scripts\python.exe -m pytest -n 0 lib/crewai/tests/agents/test_agent_executor.py -k "show_logs_is_visible_when_human_input_requested"

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: ed995c69-acb7-4a33-bd96-9f2b62d83393

📥 Commits

Reviewing files that changed from the base of the PR and between 3d72c70 and f684a2b.

📒 Files selected for processing (3)
  • lib/crewai/src/crewai/agents/crew_agent_executor.py
  • lib/crewai/src/crewai/experimental/agent_executor.py
  • lib/crewai/tests/agents/test_agent_executor.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Human input visibility

Layer / File(s) Summary
Update executor log visibility
lib/crewai/src/crewai/agents/crew_agent_executor.py, lib/crewai/src/crewai/experimental/agent_executor.py
_show_logs now marks AgentLogsExecutionEvent as verbose when agent verbosity, crew verbosity, or human input is enabled.
Validate executor log events
lib/crewai/tests/agents/test_agent_executor.py
Tests cover the experimental and legacy executors with disabled verbosity and enabled human input. They assert the emitted event contains the final answer and verbose=True.

Suggested reviewers: lorenzejay

Merge Risk: ⚪ Minimal · up to f684a

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)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: displaying the human-input result.
Description check ✅ Passed 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 otherw…
Linked Issues check ✅ Passed The changes satisfy issue #6072 by enabling result display during human input for both AgentExecutor and CrewAgentExecutor, including when verbosity is disabled. Regression tests cover both executor p…
Out of Scope Changes check ✅ Passed The implementation changes and regression tests are directly related to issue #6072 and the stated objectives. No unrelated changes are shown.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files.
Full details: Description check

Explanation

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 check

Explanation

The changes satisfy issue #6072 by enabling result display during human input for both AgentExecutor and CrewAgentExecutor, including when verbosity is disabled. Regression tests cover both executor paths.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VANDRANKI VANDRANKI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] human_input=True: the feedback prompt references a "Final Result above" that is never displayed unless verbose=True

2 participants