-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync history to stream #2640
Merged
Merged
Sync history to stream #2640
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
64d3465
add event to stream before budget check
enyst 2ae5d1b
Merge branch 'main' into enyst/history_sync
enyst 3ad34a9
Merge branch 'main' of github.com:OpenDevin/OpenDevin into enyst/hist…
enyst 05e4406
make the budget check before the step
enyst 12ab433
Merge branch 'main' into enyst/history_sync
enyst 6da5c7d
Update opendevin/controller/agent_controller.py
enyst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would cause some trouble for delegation at least. When you add an event to the stream, its callback is called. In delegation scenario, the control is then handed over to child agent (controller). Even if we just exceeded the budget during this step, the child agent would still continue because we haven't computed and checked budget yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this scenario you're thinking of at the beginning of delegation, so when the event is a delegate action?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when event is
AgentDelegateAction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, we could stop it at some point ( perhaps
on_event
or follow up), though I'm not sure it will be pretty. Or when the controller is about to start and initializes the budget (oops error). I guess we could even, if it seems better, set the agent to ERROR, then add the event; to check for that state and stop the process. I'm not anymore at the computer, will give it some thought. If we can't, IMHO an alternative is to cancel, that is, this action "doesn't exist". I still don't see it in history unless it's in the stream...(On a side note, the funny thing here is that I literally couldn't merge the current logic. Because histories are copies of the event stream in
main
, and the copies will vanish when we refactor to have the event stream as the source of truth. There's no 'space' between add_history and add_event anymore 😅 )There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the worst case, we could merge this PR as it is, and don't care about the budget thing I mentioned. It won't be ideal but not too bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree, but maybe the simplest is to just move the budget check before the call to the agent
step
. It seems like it would work, to stop the next step... Will check.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah sounds like a plan.