Add a max_actions_per_run variable on AgentService as a backstop#535
Merged
Add a max_actions_per_run variable on AgentService as a backstop#535
max_actions_per_run variable on AgentService as a backstop#535Conversation
Contributor
Author
|
Note: On staging, the failed telegram test is fixed by #531 |
douglas-reid
approved these changes
Aug 29, 2023
Contributor
douglas-reid
left a comment
There was a problem hiding this comment.
This seems like a fine solution. I wonder if we'll see 5 be considered too few however. We should at least two for the simplest Tool invocation (tool + finish action).
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.
An observed failure mode of a reasoning Agent is when it spirals into endlessly calling tools.
In a development loop, the programmer can quickly break the loop, but in a hosted situation this can result in surprising costs if each tool involves LLM usage.
This PR adds a simple backstop in which the
max_actions_per_runvariable on AgentService (default = 5) acts as a limit on how many actions the agent is permitted to run before being stopped.If the AgentService attempts to run an action after
max_actions_per_runhas been reached, it is treated as an error which will be returned to the chat invoker.