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 CLI and Headless docs for after release #5941

Merged
merged 2 commits into from
Jan 2, 2025
Merged

Fix CLI and Headless docs for after release #5941

merged 2 commits into from
Jan 2, 2025

Conversation

mamoodi
Copy link
Collaborator

@mamoodi mamoodi commented Dec 31, 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

Fix CLI and Headless docs for after release


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

First version 0.18 needs to be released. Just prepping this up so we don't forget.


Link of any specific issues this addresses
#5535


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:d41fd98-nikolaik   --name openhands-app-d41fd98   docker.all-hands.dev/all-hands-ai/openhands:d41fd98

@enyst
Copy link
Collaborator

enyst commented Dec 31, 2024

This is different from CLI Mode, which is interactive, and better for active development.

Maybe we'd like it to be better, in time, but as of now I would remove that. Currently it seems that compared to main.py, cli.py:

  • doesn't restore sessions
  • doesn't allow naming sessions
  • or most other cli parameters.

These are limitations that are on my TODO list to fix. FWIW, I am using main.py most of the time, and I definitely think it's "better". It's a subjective thing after all.

@mamoodi
Copy link
Collaborator Author

mamoodi commented Dec 31, 2024

This is different from CLI Mode, which is interactive, and better for active development.

Maybe we'd like it to be better, in time, but as of now I would remove that. Currently it seems that compared to main.py, cli.py:

  • doesn't restore sessions
  • doesn't allow naming sessions
  • or most other cli parameters.

These are limitations that are on my TODO list to fix. FWIW, I am using main.py most of the time, and I definitely think it's "better". It's a subjective thing after all.

I'll have to come back to this because I found more issues. Maybe you know more.

By passing the new .openhands-state through the -v param as I've done in the PR, both the Headless and CLI create a session that seem to always persist?
For example in headless if you give it a task to "create a hello world program in bash" it will do it.
If you then delete the file and re-run the same command, because previously it had already accomplished that task, it will not do it again because it says it was already done.

Robert tells me this isn't desired behavior. I'm guessing we need to pass something into the command so it knows it's a new task? Kind of confused how all of this works with all the new settings changes.

@enyst
Copy link
Collaborator

enyst commented Dec 31, 2024

Thank you, mamoodi, that's a good point. Hmm. OK, let's give it some thought.

What we can always do, with main.py, is send it the command line parameter -n, which is a session name. So when I send something like main.py -t "some task" -n "bedrock1", it runs the task on a "bedrock1_4u7462...etc" event stream.

Then if I want a new session, I can do main.py -t "some task" -n "bedrock2", which runs the task on a different session name (thus different event stream, "bedrock2_blah-blah-a-hash). If I never used that before, it's a new, empty stream, there are no events to load.

@mamoodi
Copy link
Collaborator Author

mamoodi commented Dec 31, 2024

That's interesting. I can test it out and see if that works. Thanks!

If it does work, it might be worth it to rejig the documentation for CLI and Headless a bit.
Basically add the changes I have in my current PR, but then at the end of CLI and Headless, add some documentation for some of the different flags you can pass to the command, such as the -n which ensures a unique session. Thoughts?

@enyst
Copy link
Collaborator

enyst commented Dec 31, 2024

Yes, that's my thought as well.

@mamoodi
Copy link
Collaborator Author

mamoodi commented Jan 2, 2025

@enyst with the changes done on main, the current changes in the PR work as expected. I'd like to get this in along with the release. Then will circle back and rejig the documentation. Thanks so much for your help here. I'm starting to understand it.

@mamoodi mamoodi marked this pull request as ready for review January 2, 2025 15:21
@mamoodi mamoodi enabled auto-merge (squash) January 2, 2025 16:03
@mamoodi mamoodi merged commit b73bac6 into main Jan 2, 2025
15 checks passed
@mamoodi mamoodi deleted the mh/fix-docs branch January 2, 2025 16:26
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