OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Debugging sandbox documentation

Open gordicaleksa opened this issue 1 year ago • 2 comments

I was wondering if there are any instructions for debugging the sandbox environement similar to this:

https://docs.all-hands.dev/modules/usage/how-to/debugging

which "will allow debugging the agent, controller and server elements, but not the sandbox"

Thanks!

gordicaleksa avatar Jan 04 '25 14:01 gordicaleksa

I figured out a workaround:

  1. I hardcode the default value for LOG_TO_FILE and LOG_ALL_EVENTS to true ('1') as apparently the launch.json specification:
            "env": {
                "LOG_ALL_EVENTS": "1",
                "LOG_TO_FILE": "1",
            },

impacts the rest of the system (frontend and backend minus the sandbox) but the env vars inside of sandbox pull from some different source as they are not set to true for some reason.

  1. I use logger.info in sandbox instead of logger.debug

  2. now i can log into the docker container via docker exec -it <container id> bash and navigate to /openhands/code/logs and then cat the log file

gordicaleksa avatar Jan 04 '25 17:01 gordicaleksa

Ideally we'd have an option to step through the code, and put breakpoints, similar as for the rest of the codebase (the debugging docs i shared above) - but for now this unblocks me a bit.

gordicaleksa avatar Jan 04 '25 17:01 gordicaleksa

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 04 '25 01:02 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Feb 11 '25 01:02 github-actions[bot]

We now have the ability to run on a local runtime, without docker, which may help much more, assuming of course use cases for which sandboxing isn't necessary.

enyst avatar Feb 11 '25 04:02 enyst