Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/crewai/src/crewai/experimental/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ def messages(self, value: list[LLMMessage]) -> None:
"""Set state messages."""
self._state.messages = value

@property # type: ignore[misc]
def ask_for_human_input(self) -> bool:
"""Compatibility property - returns human-input state flag."""
return bool(self._state.ask_for_human_input)

@ask_for_human_input.setter
def ask_for_human_input(self, value: bool) -> None:
"""Set human-input state flag."""
self._state.ask_for_human_input = value

@start()
def generate_plan(self) -> None:
"""Generate execution plan if planning is enabled.
Expand Down
12 changes: 12 additions & 0 deletions lib/crewai/tests/agents/test_agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ def test_executor_initialization(self, mock_dependencies):
assert executor.max_iter == 10
assert executor.use_stop_words is True

def test_ask_for_human_input_proxies_state(self, mock_dependencies):
"""Human-input providers should access the executor flag directly."""
executor = _build_executor(**mock_dependencies)

executor.ask_for_human_input = True
assert executor.state.ask_for_human_input is True
assert executor.ask_for_human_input is True

executor.ask_for_human_input = False
assert executor.state.ask_for_human_input is False
assert executor.ask_for_human_input is False

def test_initialize_reasoning(self, mock_dependencies):
"""Test flow entry point."""
with patch.object(
Expand Down