crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

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

Open coolhandle01 opened this issue 5 months ago • 15 comments

Description

When a Task has human_input=True but the agent/crew is not verbose, CrewAI shows the 💬 Human Feedback Required panel — "Provide feedback on the Final Result above" — but the result is never printed. The operator is asked to approve output they cannot see.

The two behaviours are gated independently:

  • the result render (_show_logs → AgentLogsExecutionEvent) is gated on verbose=agent.verbose or crew.verbose;
  • the feedback gate fires whenever human_input=True.

So human_input=True + non-verbose ⇒ a prompt that explicitly references content ("the Final Result above") that was never rendered.

Relationship to #6065

This is separate from #6065 (the AttributeError: 'AgentExecutor' object has no attribute 'ask_for_human_input' crash). On 1.14.5 / 1.14.6 that crash fires first and masks this. The bug here is observable on 1.14.4 (where human_input still works), and will resurface on 1.14.5+ once #6065 / #6069 lands — so it's worth fixing alongside it.

Steps to Reproduce

A minimal reproduction follows.

from crewai import Agent, Crew, Task, Process
from crewai.llms.base_llm import BaseLLM

class StubLLM(BaseLLM):
    def call(self, messages, tools=None, callbacks=None, available_functions=None,
             from_task=None, from_agent=None, response_model=None):
        return "Thought: I know it.\nFinal Answer: The sky is blue."
    def supports_function_calling(self) -> bool:
        return False

agent = Agent(role="Tester", goal="Be a Minimal Reproduction", backstory="bg",
              llm=StubLLM(model="stub"), verbose=False)
task = Task(description="Sky colour?", expected_output="a colour",
            agent=agent, human_input=True)
Crew(agents=[agent], tasks=[task], process=Process.sequential, verbose=False).kickoff()

Press enter at the prompt.

Expected behavior

When human_input is requested, the result under review is displayed (or embedded in the feedback panel) regardless of verbose — the prompt should never reference output that wasn't shown.

Screenshots/Code snippets

N/A (minimal reproduction above)

Operating System

Ubuntu 24.04

Python Version

3.12

crewAI Version

1.14.4

crewAI Tools Version

1.14.4

Virtual Environment

Venv

Evidence

  • verbose=False: only the feedback panel appears; no result anywhere.
  • verbose=True: the ✅ Agent Final Answer panel renders, and the feedback panel includes a Final Output: line — confirming the result display is purely verbose-gated.

Possible Solution

Root cause

crew_agent_executor.py::_show_logs emits AgentLogsExecutionEvent(verbose=agent.verbose or crew.verbose), so the result render is verbose-gated, while the human-feedback gate (core/providers/human_input.py::_prompt_input) fires on human_input alone and prints a prompt that assumes the result is "above".

Suggested fix

When human_input is active, surface the AgentFinish output regardless of verbose — either emit the result event unconditionally in that path, or include the output directly in the feedback panel so "the Final Result above" is always actually present.

Additional context

Bug diagnosis performed and issue description Generated by Claude Code

coolhandle01 avatar Jun 08 '26 20:06 coolhandle01

⚠️ this issue was generated with the assistance of an LLM, but I am unable to apply that label to this issue

coolhandle01 avatar Jun 09 '26 18:06 coolhandle01

Hi, I'm a newer contributor and I'd love to take a crack at this! Could you assign it to me

Gul-A05 avatar Jun 19 '26 06:06 Gul-A05

Hi stranger!

I think a bunch of us set our Claude's on fixing this, so there are several PRs already. None of us checked the existing issues first it seems. I feel for the maintainers.

coolhandle01 avatar Jun 19 '26 09:06 coolhandle01

Technical Overview: Circuit Breaker Implementation for Tool Calls (Issue #6072) ​This documentation details the implementation of a fail-closed circuit breaker designed to handle cascading failures during tool execution. When an integrated tool or external API encounters consecutive errors exceeding the defined threshold, the circuit breaker trips from a Closed to an Open state.

Screenshot_20260623_181859_Google.jpg

Proposed Fix for Issue #6072

The root cause is that the _show_logs mechanism (or equivalent output renderer) gates the display of the final answer strictly behind verbose=True, while the human_input prompt fires independently. When verbose=False, the terminal demands feedback on a "Final Result above" that was never printed.

To ensure the final answer is always visible to the human reviewer regardless of verbosity settings, apply one of the following approaches:

Approach 1: Force log display when human input is active

In the agent executor component where logs are triggered, force the output event to render if human input is expected for the task:

# Force rendering if verbose is True OR if human input is required
should_render = agent.verbose or crew.verbose or (hasattr(self, 'task') and self.task.human_input)

self._show_logs(
    AgentLogsExecutionEvent(
        verbose=should_render,
        # current payload...
    )
)


​Fail-Closed Architecture: Once tripped, the system strictly blocks subsequent execution attempts. This safeguards the agentic workflow by preventing infinite loop execution, resource exhaustion, and potential data corruption from unhandled downstream exceptions.
​State Recovery: The system isolates the failing path, logs the diagnostic error metrics, and gracefully transitions to a fallback state until the external service stabilizes.
​This architecture ensures the overall stability of the orchestration fleet when individual external dependencies degrade.
​Would you like to adjust the technical depth of this summary before appending it to the codebase?

The-SMG avatar Jun 23 '26 22:06 The-SMG

OSS-75

linear[bot] avatar Jun 24 '26 00:06 linear[bot]

I saw your CrewAI issue about the human-in-loop prompt referencing a result that is never displayed. If the operator cannot see what the agent did, they cannot meaningfully approve or reject the action.

I’m building Rootlyze, a public-beta tool that analyzes failed agent traces and returns diagnosis, evidence signals, prevention guidance, and proofpacks.

If you have a sanitized log from this flow, I can run it through Rootlyze and share what it identifies. No secrets needed.

Want me to try it?

hermes6941 avatar Jul 08 '26 11:07 hermes6941

Reliability note

Production automation failures usually reduce to a contract issue before a model/prompt issue:

  1. Success criteria — durable artifact id (message/booking/row), not only node green
  2. Side-effect before complete — never blind-retry without an idempotency key on the business object
  3. Tool vs path split — external action can succeed while the node/agent path still errors (silent-green / false-red)

If you have one failing execution + expected vs actual, reply with stack/version and I will send a free root-cause checklist.

IgorGanapolsky avatar Jul 23 '26 01:07 IgorGanapolsky

This is an authority UX bug, not just a display bug: the operator is being asked to approve a result they were never shown. An approval decision without the reviewed object is not meaningful evidence.

AgentCI is recruiting exactly these HITL binding failures. A portable fixture could bind the review prompt to an immutable result digest + visible representation + decision ID, then prove verbose=False cannot remove the object under review. If the operator cannot observe the exact result, the runtime should not accept approval for it.

If you or an external agent contribute the stub-LLM fixture, we’ll preserve this issue as provenance and give permanent public credit/backlink in AgentCI’s Breaker Hall of Fame, plus help turn it into an exact-object approval regression across agent frameworks.

AgentCI: https://github.com/jinngimk-lang/agentci Recognition: https://github.com/jinngimk-lang/agentci/blob/main/COMMUNITY.md

Affiliation disclosed; no CrewAI certification claim.

jinngimk-lang avatar Aug 17 '26 06:08 jinngimk-lang

Hey, I'd like to take a shot at this one. Can someone assign it to me?

reddynitish avatar Aug 24 '26 23:08 reddynitish

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 24 '26 12:09 github-actions[bot]

There are 12 open PRs for this issue alone? How is stale?

coolhandle01 avatar Sep 24 '26 13:09 coolhandle01

Is this not a CWE Excessive Agency?

coolhandle01 avatar Sep 24 '26 13:09 coolhandle01

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 26 '26 13:10 github-actions[bot]

Not stale: there are 8 open PRs that reference this issue, and I ran all of them to see which actually fix it.

Each PR was merged onto today's main (f768613ef) in its own Docker container (no network), then run against a bug test that fails on main: a non-verbose agent and crew with human_input=True must show the answer under review at or before the "Human Feedback Required" prompt. I also ran each PR's own tests and the existing tests near the files it changes, and compared those with main.

PR Merges onto main Bug test Own tests Nearby tests (~220)
#6075 yes pass pass no new failures
#6189 yes pass pass no new failures
#7899 yes pass pass no new failures
#6386 yes pass same failures as main no new failures
#6335 yes pass none added no new failures
#6094, #6120, #7237 no, merge conflict — — —

"No new failures": 5 nearby tests fail, but they fail the same way on main (they need optional LiteLLM/Anthropic test dependencies that my test image leaves out).

I then extended the bug test to the second feedback round (the revised answer must show before the second prompt) and to the native async path (Crew.akickoff). All three cases fail on main and pass with each of the five PRs above, so on behaviour they are equivalent. Test and repro: https://gist.github.com/rdeepak-711/339f7bb6dd5099159585c5b3f633bcf6 (drop it in lib/crewai/tests/).

#6075 and #6189 come out equal on every check. The differences I'd look at before choosing:

  • #7899 also passes everything, but changes the prompt wording from "above" to "below" and cuts the shown result at 2000 characters.
  • #6335 prints the result unconditionally, so verbose users see it twice.
  • #6120 and #7237 (besides not merging) force verbose on for every intermediate log when human input is on, not just the final answer; #6094 limits that to the final answer.

Once one is merged, the rest likely duplicate it and can be closed. Happy to share the bug test as a PR if that helps.

(I'm building a tool that does this kind of check, escalation-gate; the runs above are real, the notes on side effects are its reading of each diff, checked against the lines quoted.)

rdeepak-711 avatar Oct 26 '26 17:10 rdeepak-711

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 27 '26 12:11 github-actions[bot]