Skip to content

Conversation

@djriffle
Copy link
Member

@djriffle djriffle commented Jun 2, 2025

This pull request introduces significant updates to the InteractiveAgentTester.py script, expanding its functionality to support an additional backend (singularity-exec) and improving code readability and maintainability. The changes also include updates to the Singularity sandbox configuration file to accommodate the new backend.

Backend enhancements:

  • Added support for the singularity-exec backend, which enables offline REPL execution without networking. This includes a new _SingExecBackend class to manage container lifecycle, data binding, and code execution.
  • Refactored backend selection logic to include the new backend option and adjusted helper methods like COPY_CMD and EXECUTE_ENDPOINT to handle backend-specific behavior. [1] [2]

Code execution improvements:

  • Updated the run_interactive method to handle code execution differently for singularity-exec by using the exec_code method of _SingExecBackend. Networked backends continue to use HTTP requests.
  • Simplified the format_execute_response method to process execution results consistently across backends, including handling images and output streams.

Code readability and maintainability:

  • Improved formatting and readability across the script, including consistent indentation and better naming conventions for variables and methods. For example, renamed lst to res in collect_resources. [1] [2]
  • Refactored helper functions like extract_python_code and display for clarity and modularity. [1] [2]

Singularity sandbox updates:

  • Added offline_kernel.py to the Singularity sandbox definition file to support the singularity-exec backend. This ensures the required REPL script is available inside the container.

These changes collectively enhance the flexibility of the testing framework, allowing it to operate in environments with restricted networking while maintaining modular and clean code.

@djriffle djriffle merged commit 6e7f7b0 into main Jun 2, 2025
1 check passed
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