docs: clarify ReAct loop depth controls#4042
Draft
deepujain wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains:
What is the current behavior? (You can also link to an open issue here)
The ReAct agent documentation explains continuation handling and the submit tool separately, but it does not give users a direct pattern for bounding a ReAct agent's loop depth. In fixed-turn agent conversations, this makes it hard to tell whether to disable
submit(), rely onon_continue, or use sample limits.Closes #2716.
What is the new behavior?
submit=Falseand lets the outer workflow decide turn order withrun().on_continuecallback to stop after a bounded number of assistant turns or send a targeted continuation message.Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No. This is a docs-only change and does not alter runtime behavior.
Other information:
Validation:
uv run pytest tests/agent/test_agent_react.py -vsubmit=False, custom submit tools, string and callableon_continue, retry/refusal handling, and truncation paths.uv run make checkuv run make testCI/CD coverage expected: