crewai - 💡(How to fix) Fix [BUG] human_input=True on Task raises AttributeError: 'AgentExecutor' object has no attribute 'ask_for_human_input' with default experimental executor

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When human_input=True is set on a Task, the crew execution fails with:

"An unknown error occurred. Please check the details below. Error details: 'AgentExecutor' object has no attribute 'ask_for_human_input'"

This happens because the new default executor (crewai.experimental.AgentExecutor) does not expose ask_for_human_input as a direct instance attribute — it stores the flag inside self.state.ask_for_human_input — but the ExecutorContext protocol and SyncHumanInputProvider.handle_feedback both expect it as a direct attribute on the executor object.

Error Message

"An unknown error occurred. Please check the details below. Error details: 'AgentExecutor' object has no attribute 'ask_for_human_input'" Execution fails with AttributeError: 'AgentExecutor' object has no attribute 'ask_for_human_input' wrapped inside the generic "An unknown error occurred" message. "An unknown error occurred. Please check the details below. Error details: 'AgentExecutor' object has no attribute 'ask_for_human_input'"

Root Cause

This happens because the new default executor (crewai.experimental.AgentExecutor) does not expose ask_for_human_input as a direct instance attribute — it stores the flag inside self.state.ask_for_human_input — but the ExecutorContext protocol and SyncHumanInputProvider.handle_feedback both expect it as a direct attribute on the executor object.

Fix Action

Fix / Workaround

Workaround

RAW_BUFFERClick to expand / collapse

Description

When human_input=True is set on a Task, the crew execution fails with:

"An unknown error occurred. Please check the details below. Error details: 'AgentExecutor' object has no attribute 'ask_for_human_input'"

This happens because the new default executor (crewai.experimental.AgentExecutor) does not expose ask_for_human_input as a direct instance attribute — it stores the flag inside self.state.ask_for_human_input — but the ExecutorContext protocol and SyncHumanInputProvider.handle_feedback both expect it as a direct attribute on the executor object.

Steps to Reproduce

from crewai import Agent, Task, Crew, LLM

llm = LLM(model="ollama/llama3", base_url="http://localhost:11434")

agent = Agent( role="Researcher", goal="Find information", backstory="You are a researcher.", llm=llm, verbose=True, )

task = Task( description="Research topic X.", expected_output="A summary of topic X.", human_input=True, # <-- triggers the bug agent=agent, )

crew = Crew(agents=[agent], tasks=[task], verbose=True) crew.kickoff()

Expected behavior

After the agent completes the task, execution pauses and prompts the user for feedback, as documented for human_input=True.

Screenshots/Code snippets

Execution fails with AttributeError: 'AgentExecutor' object has no attribute 'ask_for_human_input' wrapped inside the generic "An unknown error occurred" message.

Operating System

Windows 11

Python Version

3.12

crewAI Version

crewai: 1.14.6

crewAI Tools Version

crewai-tools: 1.14.6

Virtual Environment

Venv

Evidence

When human_input=True is set on a Task, the crew execution fails with:

"An unknown error occurred. Please check the details below. Error details: 'AgentExecutor' object has no attribute 'ask_for_human_input'"

Note: unfortunately I am reporting this bug after my current API usage session limit was exhausted. As soon as I have my session limit restored, I will provide screenshots or more detailed evidence.

Possible Solution

Root cause

The ExecutorContext protocol (crewai/core/providers/human_input.py:26) declares ask_for_human_input: bool as a required direct attribute:

class ExecutorContext(Protocol): ask_for_human_input: bool # line 26 ...

SyncHumanInputProvider._handle_regular_feedback reads and writes this attribute directly on the executor passed as context:

while context.ask_for_human_input: # direct read ... context.ask_for_human_input = False # direct write

The deprecated CrewAgentExecutor satisfies this — ask_for_human_input is a top-level Pydantic field:

crewai/agents/crew_agent_executor.py:129

ask_for_human_input: bool = Field(default=False)

The new default AgentExecutor (crewai/experimental/agent_executor.py) does not. The field is defined on AgentExecutorState (the Flow state class), not on the executor itself:

AgentExecutorState (line 132) — NOT on AgentExecutor

ask_for_human_input: bool = Field(default=False)

The executor's invoke() correctly uses self.state.ask_for_human_input, but then passes self to _handle_human_feedback as an ExecutorContext, where the direct attribute access fails:

experimental/agent_executor.py:3025

return provider.handle_feedback(formatted_answer, cast("ExecutorContext", self))

↑ self.ask_for_human_input does not exist — only self.state.ask_for_human_input does


Proposed fix

Add a property to AgentExecutor (crewai/experimental/agent_executor.py) that delegates ask_for_human_input to the state, making it satisfy the ExecutorContext protocol:

@property def ask_for_human_input(self) -> bool: return self.state.ask_for_human_input

@ask_for_human_input.setter def ask_for_human_input(self, value: bool) -> None: self.state.ask_for_human_input = value


Additional context

Workaround

Explicitly set executor_class=CrewAgentExecutor on each agent (note: this class is deprecated and will generate a warning):

from crewai.agents.crew_agent_executor import CrewAgentExecutor

agent = Agent( ... executor_class=CrewAgentExecutor, )

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After the agent completes the task, execution pauses and prompts the user for feedback, as documented for human_input=True.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING