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

refactor: Replace pexpect with libtmux in BashSession #4881

Draft
wants to merge 112 commits into
base: main
Choose a base branch
from

Conversation

xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Nov 10, 2024

  • Simplified implementation using libtmux instead of pexpect
  • Added proper handling of command errors, interactive commands, and timeouts
  • Added test suite to verify behavior
  • Improved output handling and error detection

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

Collaborated with OpenHands:


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

openhands-agent and others added 30 commits November 10, 2024 18:12
- Simplified implementation using libtmux instead of pexpect
- Added proper handling of command errors, interactive commands, and timeouts
- Added test suite to verify behavior
- Improved output handling and error detection
…ould do it in the CmdOutputObservation end for keep_prompt
- Add tests for missing fields in PS1 metadata
- Add tests for malformed values in numeric fields
- Add tests for boolean values in numeric fields
- Fix JSON parsing in test_ps1_metadata_json_structure
- Fix handling of malformed values in from_ps1_match
- Move error handling from from_ps1_match to from_ps1
- Let from_ps1_match raise exceptions for invalid data
- Update tests to match new error handling behavior
- Add support for float values in numeric fields
- Fix regex pattern to handle different line endings
- Add more test cases for edge cases
- Keep valid string fields when numeric fields fail to parse
- Use re.escape() to properly escape special characters in markers
- Use constants to avoid duplication
- Update tests to use constants and handle newlines consistently
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.

3 participants