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

Commits on Nov 10, 2024

  1. refactor: Replace pexpect with libtmux in BashSession

    - 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
    openhands-agent committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    7b86e33 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9e5653c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    522eb53 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d60065b View commit details
    Browse the repository at this point in the history
  5. greatly simplify command to not accepting blocking/keep_prompt, we sh…

    …ould do it in the CmdOutputObservation end for keep_prompt
    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    e304973 View commit details
    Browse the repository at this point in the history
  6. fix PS1 so PS1JSON works

    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    c743833 View commit details
    Browse the repository at this point in the history
  7. support pid

    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    49eae72 View commit details
    Browse the repository at this point in the history
  8. preliminary impl of bash

    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    363b379 View commit details
    Browse the repository at this point in the history
  9. slight refactor of cmd

    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    ffa0676 View commit details
    Browse the repository at this point in the history
  10. add blocking back

    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    554e03a View commit details
    Browse the repository at this point in the history
  11. add blocking back

    xingyaoww committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    2b252e0 View commit details
    Browse the repository at this point in the history
  12. Improve test coverage for CmdOutputMetadata

    - 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
    openhands-agent committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    e994620 View commit details
    Browse the repository at this point in the history
  13. Refactor error handling in CmdOutputMetadata

    - 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
    openhands-agent committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    1935483 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2024

  1. Improve CmdOutputMetadata handling of malformed values and line endings

    - 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
    openhands-agent committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    23ddbe4 View commit details
    Browse the repository at this point in the history
  2. Refactor PS1 metadata regex pattern

    - Use re.escape() to properly escape special characters in markers
    - Use constants to avoid duplication
    - Update tests to use constants and handle newlines consistently
    openhands-agent committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    744938c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f5518bf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aaed596 View commit details
    Browse the repository at this point in the history
  5. add newline suffix for test

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    71e4ec5 View commit details
    Browse the repository at this point in the history
  6. add test

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    3a2443f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ceb0d32 View commit details
    Browse the repository at this point in the history
  8. remove re escape

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    145f141 View commit details
    Browse the repository at this point in the history
  9. tweak ps1

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    56e4df5 View commit details
    Browse the repository at this point in the history
  10. fix bash session arg

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9e43ee5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ed382c6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8e4180f View commit details
    Browse the repository at this point in the history
  13. fix typo

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    3c68c7d View commit details
    Browse the repository at this point in the history
  14. fix typo

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    d82c420 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    010e453 View commit details
    Browse the repository at this point in the history
  16. use pwd to get working_dir

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    4aeb681 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    28615cd View commit details
    Browse the repository at this point in the history
  18. remove warnings for pid

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9aa3e47 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    959733c View commit details
    Browse the repository at this point in the history
  20. lstrip on cmd output

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    210303c View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    e050ceb View commit details
    Browse the repository at this point in the history
  22. add tests

    xingyaoww committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    8db543d View commit details
    Browse the repository at this point in the history
  23. Improve test coverage for BashSession

    - Add test for session initialization with custom working directory and username
    - Add test for pwd property updates
    - Add test for special characters in command output
    - Add test for multiple commands in sequence
    - Add test for long-running commands with output
    - Add test for multiline command input
    - Add test for ANSI escape codes
    - Add test for long output
    openhands-agent committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    3dd21fa View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2024

  1. Configuration menu
    Copy the full SHA
    efc481f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    03ba929 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    92b2b0c View commit details
    Browse the repository at this point in the history
  4. fix command prefix

    xingyaoww committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    fec3083 View commit details
    Browse the repository at this point in the history
  5. tweak debug viz

    xingyaoww committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    a28212b View commit details
    Browse the repository at this point in the history
  6. print agent obs

    xingyaoww committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    f03de49 View commit details
    Browse the repository at this point in the history
  7. tweak

    xingyaoww committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    42b69a3 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2024

  1. Configuration menu
    Copy the full SHA
    4ee07fe View commit details
    Browse the repository at this point in the history
  2. make timeout configurable

    xingyaoww committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    99ef1ef View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34a14fd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c3ae9cf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3affa77 View commit details
    Browse the repository at this point in the history
  6. add missing newlines

    xingyaoww committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    d90a338 View commit details
    Browse the repository at this point in the history
  7. fix ctrl+c

    xingyaoww committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    4d47241 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3e1f12b View commit details
    Browse the repository at this point in the history
  9. tweak bash doc

    xingyaoww committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    0df9ba2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ebeccc6 View commit details
    Browse the repository at this point in the history
  11. fix all bash session tests

    xingyaoww committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    fa351fe View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2024

  1. Configuration menu
    Copy the full SHA
    0c14a80 View commit details
    Browse the repository at this point in the history
  2. fix linter

    xingyaoww committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    77b4c7c View commit details
    Browse the repository at this point in the history
  3. add tmux to Dockerfile

    xingyaoww committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    bc3428a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7a8ff37 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f9f37ad View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fae1185 View commit details
    Browse the repository at this point in the history
  7. fix cmdoutput constructor

    xingyaoww committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    184794a View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2024

  1. handle multi line session

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    e1c2ac2 View commit details
    Browse the repository at this point in the history
  2. fix multiline runtime tests

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    fce1b07 View commit details
    Browse the repository at this point in the history
  3. (hopefully) fix all tests

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    fab1438 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c7aee63 View commit details
    Browse the repository at this point in the history
  5. update poetry lock

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    f5d23b3 View commit details
    Browse the repository at this point in the history
  6. fix security test

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    88658dd View commit details
    Browse the repository at this point in the history
  7. fix deserialization test

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    25ae18c View commit details
    Browse the repository at this point in the history
  8. refactor imports

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    488a1a7 View commit details
    Browse the repository at this point in the history
  9. fix codeact test

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    c173a03 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1bb9f82 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7752a94 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    cd94759 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d491e47 View commit details
    Browse the repository at this point in the history
  14. Revert "feat: implement keep_prompt handling in BashSession and add t…

    …ests"
    
    This reverts commit d491e47.
    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    d76bbfa View commit details
    Browse the repository at this point in the history
  15. Revert "feat: add keep_prompt parameter to CmdRunAction"

    This reverts commit cd94759.
    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    4d1c742 View commit details
    Browse the repository at this point in the history
  16. refactor: move prefix/suffix to CmdOutputMetadata

    - Add prefix and suffix fields to CmdOutputMetadata
    - Update bash.py to use metadata fields instead of string concatenation
    - Update CmdOutputObservation to use metadata fields in to_agent_observation
    openhands-agent committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    51d0bcb View commit details
    Browse the repository at this point in the history
  17. test: update test_bash_session.py to verify prefix/suffix fields

    - Add assertions for prefix and suffix fields in all test cases
    - Move message strings from content assertions to suffix assertions
    - Add empty prefix assertions where appropriate
    - Update error message test to match exact content
    - Add prefix assertions for continuation messages
    - Add suffix assertions for timeout and completion messages
    openhands-agent committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    fa714a4 View commit details
    Browse the repository at this point in the history
  18. fix testcase

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    53d2de2 View commit details
    Browse the repository at this point in the history
  19. fix tests

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    fefabd1 View commit details
    Browse the repository at this point in the history
  20. improve 500 error message

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    e5001a3 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    9c00bd6 View commit details
    Browse the repository at this point in the history
  22. fix test

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    7ef9e37 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    20721e3 View commit details
    Browse the repository at this point in the history
  24. fix resolver tests

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    725eeb1 View commit details
    Browse the repository at this point in the history
  25. improve error message

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    1dfee78 View commit details
    Browse the repository at this point in the history
  26. fix resolver test

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    9fe792f View commit details
    Browse the repository at this point in the history
  27. fix test bash ps1

    xingyaoww committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    c335b1e View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    a15708a View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2024

  1. Configuration menu
    Copy the full SHA
    ff3d971 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22a2572 View commit details
    Browse the repository at this point in the history
  3. remove command id

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    904bc29 View commit details
    Browse the repository at this point in the history
  4. fix test

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    f016fbc View commit details
    Browse the repository at this point in the history
  5. fix PS1 parsing

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    0f40b4c View commit details
    Browse the repository at this point in the history
  6. fix ipython pwd

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    313a901 View commit details
    Browse the repository at this point in the history
  7. remove specified sid

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    1f9168a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1a40358 View commit details
    Browse the repository at this point in the history
  9. relax tests

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    95add43 View commit details
    Browse the repository at this point in the history
  10. resize tmux window

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    6da2636 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    bc995ef View commit details
    Browse the repository at this point in the history
  12. fix resize arg

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    153a501 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    796a100 View commit details
    Browse the repository at this point in the history
  14. tweak test

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    483f4b1 View commit details
    Browse the repository at this point in the history
  15. tweak test

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    3d7b44c View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    bd12b99 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    f2d57f9 View commit details
    Browse the repository at this point in the history
  18. hopefully fixes the bash

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    cf7897b View commit details
    Browse the repository at this point in the history
  19. fix empty cmd handling

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    b430cb4 View commit details
    Browse the repository at this point in the history
  20. fix test

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    bae44a7 View commit details
    Browse the repository at this point in the history
  21. fix request

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    60daaa3 View commit details
    Browse the repository at this point in the history
  22. fix VERY long cmd output

    xingyaoww committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    04397fe View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    206eb19 View commit details
    Browse the repository at this point in the history