Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amanape
Copy link
Member

@amanape amanape commented Oct 29, 2024

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

  • Handle case of incorrect model

Link of any specific issues this addresses

@amanape amanape self-assigned this Oct 29, 2024
Copy link
Collaborator

@enyst enyst left a 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!

@amanape
Copy link
Member Author

amanape commented Oct 29, 2024

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

@amanape amanape changed the title feat: Extend error handling feat: Extend error handling for the UI Oct 29, 2024
@enyst
Copy link
Collaborator

enyst commented Oct 29, 2024

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:

  • I do agree with doing it now in agent_controller, since that's the place we already use for this kind of thing. I am fine with this PR as is.
  • I become more and more convinced it's also wrong. It's the way things are today, but we're taking another look at it, and may change it.

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.

@enyst
Copy link
Collaborator

enyst commented Oct 29, 2024

Please @amanape feel free to participate to the discussion linked above, we need you. ❤️ There's this slack too.

@@ -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 ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will send to the chat box the rest of exceptions, and that's actually surprising. For example:
Screenshot 2024-10-29 at 10 41 43

I think the (currently) intended behavior is to not show these, or at least make a generic user-friendly message for them. Or did we really change that intention?

Copy link
Member Author

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.

Copy link
Collaborator

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.

@amanape
Copy link
Member Author

amanape commented Oct 29, 2024

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants