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

Fix action execution server JSONResponse #7721

Merged
merged 1 commit into from
Apr 7, 2025
Merged

Conversation

li-boxuan
Copy link
Collaborator

@li-boxuan li-boxuan commented Apr 6, 2025

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

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.

I was debugging action_execution_server on windows and found this bug. My debugging scenario:

  1. Launching server: poetry run python -u -m openhands.runtime.action_execution_server 37234 --working-dir D:\workspace\ --plugins agent_skills jupyter --username boxuanli --user-id 1000
  2. Calling API endpoint: curl -X POST -d '...payload...' http://localhost:37234/execute_action

Without converting to str, I sometimes see {"detail":"An unexpected error occurred. Please try again later."} from client side when there's an error message that contains bytes. On server side, the error is TypeError: Object of type bytes is not JSON serializable.

This PR fixes this bug by converting the error to string.


Link of any specific issues this addresses.


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:07ea4b3-nikolaik   --name openhands-app-07ea4b3   docker.all-hands.dev/all-hands-ai/openhands:07ea4b3

Copy link
Collaborator

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

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

Thanks!

@xingyaoww xingyaoww merged commit e951da7 into main Apr 7, 2025
14 checks passed
@xingyaoww xingyaoww deleted the boxuanli/server-fixes branch April 7, 2025 14:49
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