-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feat: Extend error handling for the UI #4601
base: main
Are you sure you want to change the base?
Conversation
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.
Capturing this is welcome, but I think we'll need to do this kind of thing elsewhere (like agent session
). Just a note, it's not an issue for this PR, thanks!
This draft is actually for the UI. The frontend looks for error observations and displays them inline in the chat interface. This just makes it more human-readable. I'm looking for more cases where we would expect an error in the UI but don't receive it Don't know if that would still mean we should consider doing it in agent session. LMK |
Yes, I know it's for the UI, and it's welcome that the UI would present some errors to the user, in a user-friendly way. We talked about this before, sorry if something was unclear in my comment. What I meant is simply that:
Up to you, IMHO this PR doesn't have to adapt to the change before it happens. I am fine with this PR as it is. I can take care of merging this appropriately in 4575, depending what that solution will look like. |
@@ -144,8 +144,11 @@ async def report_error(self, message: str, exception: Exception | None = None): | |||
if exception: | |||
self.state.last_error += f': {exception}' | |||
detail = str(exception) if exception is not None else '' |
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.
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.
The current default behaviour is display errors that are ErrorObservation
's (e.g., those called with report_error
) and a temporary toast for errors sent directly to the WebSocket such as response errors (e.g., those called with send_error
).
Errors like the one in your screenshot probably shouldn't be displayed but only because the developer should handle it in the code (I doubt OpenHands can do something about internal request errors such as these).
In general, it is in my TODO list to display the errors collapsed by default, and probably truncated if they are super long.
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.
Yeah, part of the mess right now can be solved if these are not ErrorObs in the first place. OK, cool.
That would be appreciated. I just wanted to extend the app to display errors with whatever we have now. I do agree that we should refactor. I imagine we're going to want to extend this in the future to a point where we can efficiently handle any type of errors, error observations or otherwise. |
End-user friendly description of the problem this fixes or functionality that this introduces
Give a summary of what the PR does, explaining any non-trivial design decisions
Link of any specific issues this addresses