Skip to content

fix(agents): proxy human input flag through executor state#6067

Closed
fengjikui wants to merge 1 commit into
crewAIInc:mainfrom
fengjikui:fix/human-input-state-proxy
Closed

fix(agents): proxy human input flag through executor state#6067
fengjikui wants to merge 1 commit into
crewAIInc:mainfrom
fengjikui:fix/human-input-state-proxy

Conversation

@fengjikui

@fengjikui fengjikui commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • expose AgentExecutor.ask_for_human_input as a compatibility property backed by AgentExecutorState
  • add a regression test covering direct reads/writes through the executor context surface

Why

SyncHumanInputProvider accesses context.ask_for_human_input directly, but the experimental AgentExecutor stores the flag only on self.state. With Task(human_input=True), that mismatch raises AttributeError before the feedback loop can run.

Fixes #6065.

Validation

  • python3 -m py_compile lib/crewai/src/crewai/experimental/agent_executor.py lib/crewai/tests/agents/test_agent_executor.py

I was not able to run the targeted pytest locally because cloning/checking out the full repository repeatedly failed on this machine with network EOF errors; the change is limited to a state-backed compatibility property plus a focused unit test.

AI assistance disclosure

This PR was prepared with AI assistance and reviewed before submission.

Summary by CodeRabbit

  • New Features

    • Added a property to enable reading and modifying the human-input request status for Agent Executor.
  • Tests

    • Added unit test to verify the human-input property functionality and state synchronization.

@coderabbitai

coderabbitai Bot commented Jun 7, 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: Pro Plus

Run ID: e89711a3-bae9-4fdd-8c49-e9f6c27807da

📥 Commits

Reviewing files that changed from the base of the PR and between 913a3ab and 6f30178.

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

📝 Walkthrough

Walkthrough

This PR adds a getter/setter property to AgentExecutor that proxies the ask_for_human_input flag to the internal state object, ensuring the executor conforms to the ExecutorContext protocol. A unit test verifies the property correctly updates the underlying state in both directions.

Changes

ask_for_human_input Compatibility

Layer / File(s) Summary
ask_for_human_input property and test
lib/crewai/src/crewai/experimental/agent_executor.py, lib/crewai/tests/agents/test_agent_executor.py
Added a bidirectional property to AgentExecutor that proxies ask_for_human_input reads and writes to self._state.ask_for_human_input, satisfying the ExecutorContext protocol. Test confirms property mutations correctly reflect in the state object.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A property so simple, a gate to the state,
Where human input flows, no longer too late,
Get and set with grace, the protocol's in place,
One test to confirm, one bug we erase! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a property to proxy the human input flag through executor state.
Linked Issues check ✅ Passed The PR fully implements the proposed solution from issue #6065 by adding the ask_for_human_input property with getter/setter and corresponding unit test.
Out of Scope Changes check ✅ Passed All changes directly address the issue: property implementation in AgentExecutor and test coverage validating the proxy behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@fengjikui

Copy link
Copy Markdown
Author

I attempted to add the required llm-generated label per CONTRIBUTING.md, but GitHub reports I do not have permission to add labels on this repository. Maintainers: please apply that label when convenient.

@fengjikui

Copy link
Copy Markdown
Author

Closing this duplicate in favor of #6069, which contains the same fix with stronger validation and the human-input provider regression test.

@fengjikui fengjikui closed this Jun 8, 2026
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 on Task raises AttributeError: 'AgentExecutor' object has no attribute 'ask_for_human_input' with default experimental executor

1 participant