Repository navigation
Python: Autonomous handoff - inconsistent turn limit behaviour #6328
Description
Hi team, I am seeing inconsistent autonomous-mode behavior for the same workflow and same prompt when only the turn limit changes.
ref : #6240
Based on prior guidance, I understood that any valid autonomous turn limit should work consistently, not that 50 is a special case.
Test setup
- Orchestration type: Handoff
- Agents: 2 total (1 start agent + 1 additional agent)
- Agent description: This agent assists developers with coding tasks and technical queries
- Agent instruction: You are an expert programming assistant. Help users write, debug, and optimize code. Provide clear explanations and best practices
- Prompt: same in all runs
- Variable changed per run: autonomous turn limit only
- Providers tested:
- Azure OpenAI Chat Completion Agents
- Foundry Chat Client
Autonomous prompts tested
1. "User did not respond. Continue assisting autonomously"
2. "Continue autonomously because the user is temporarily unavailable. Do not pause or ask for clarification. Assume reasonable defaults, state assumptions briefly, and keep progressing step by step toward task completion."
Primary prompt used in all comparisons
"Build a computational genomics workflow for variant calling at scale with strict reproducibility, checkpointed execution, provenance metadata, and quality-control gates. Include algorithmic stages, data contracts, failure-retry semantics, and statistical validation framework."
Observed behavior
- Turn limit = 49: consistently received awaiting_user_response
- Turn limit = 50: receives complete (or downstream completion behavior) instead of awaiting_user_response
- Turn limit = 0 (default limit of 50 applied): receives complete
Important note
Even with a stronger autonomous prompt that explicitly says to continue and not pause, behavior at 50 is still inconsistent.
This suggests a limit-boundary behavior difference between 49 and 50 for the same flow.
Need help to get a clarity on whether this is an expected behaviour or not
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
BharathRajR commentedon Jun 9, 2026
chetantoshniwal Tao Chen (@TaoChenOSU) Evan Mattson (@moonbox3)
Hey please let me know if there are any updates on this issue?
github-actions commentedon Jun 19, 2026
👋 Hi BharathRajR — thanks for the report!
Your test setup uses real LM providers (Azure OpenAI, Foundry Chat Client) with a complex prompt ('Build a computational genomics workflow..'). Our deterministic tests show the framework correctly emits
request_info(awaiting_user_response) at turn limits 49, 50, 51, and the default—there is no boundary-condition bug in the turn limit logic. The behavioral difference you observe appears to be the LLM naturally completing its task within 50 turns (producing a 'done' response) but not within 49, which your application layer interprets as 'complete'. To confirm, it would help to see: (1) the exactWorkflowRunStateor event type you check to distinguish 'complete' vs 'awaiting_user_response', (2) whether you have a termination_condition configured, and (3) a minimal reproducible snippet showing how you invokeHandoffBuilder.with_autonomous_mode(...).If you still believe there is a framework issue here, please reply with the exact import/class or method you are using, the version, and a minimal snippet that shows the failure. 🙏