-
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
(Hotfix): Track reason for Error AgentState #7584
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a7735a6
add budget exceeded agent state
malhotra5 837b1bf
Add i18n key for BUDGET_EXCEEDED agent state
openhands-agent be0e467
Add reason field to AgentStateChangedObservation for error states
openhands-agent 94e2776
Add _last_error_reason to AgentController constructor
openhands-agent 53de84c
Remove BUDGET_EXCEEDED agent state and use ERROR state with reason in…
openhands-agent d2a20ea
add more err reasons
malhotra5 294c089
use agent state to track last err
malhotra5 72e3e79
tests: check observation contains reason
malhotra5 1c953c0
Fix lint issues in backend files
openhands-agent 5b3d576
Merge branch 'main' into budget-agent-state
malhotra5 fae4193
use err_id instead of readable msg
malhotra5 11dc511
add comment in eval file
malhotra5 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"workbench.colorTheme": "Default Dark Modern", | ||
"workbench.startupEditor": "none" | ||
} | ||
} |
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
Oops, something went wrong.
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.
I love the solution overall, we just may want to check if this works with evals, because they use
state.last_error
with some particular expectations for some errors:https://github.com/search?q=repo%3AAll-Hands-AI%2FOpenHands%20last_error&type=code
At a look, I'd say it's fine - there's a function that cares about the exception name, and it seems we're setting it here anyway, and we're changing it only for a handful below?
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.
Hmm good point, it looks like we're just saving the last error msg for eval outputs
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 can't seem to find this; I only see the following
last_error
attrib to agent statelast_error
in their outputsIn this case I think this PR should be good to go
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.
Ah, and this one:
OpenHands/evaluation/utils/shared.py
Line 523 in 648c8ff
Seems okay, the PR doesn't change those?
Edited to add: it comes from here, using last_error:
OpenHands/evaluation/benchmarks/swe_bench/run_infer.py
Line 539 in 648c8ff
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.
Ah thanks a bunch for linking this, it gives me peace of mind!
Yes this PR doesn't change those error messages
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.
You actually make a very good point, this is not straightforward to find, and since we start using
last_error
, we will modify it sooner or later. Maybe a comment on the eval usage would help in the future?