Skip to content

Conversation

@MarcCote
Copy link
Collaborator

@MarcCote MarcCote commented Oct 2, 2025

This pull request introduces improvements to file writing in the workspace and enhances the logger's debug mode activation. The most significant changes are the addition of chunked file writing to handle large contents, more robust detection of debug mode via environment variables, and expanded test coverage for edge cases in file writing.

Workspace file writing improvements:

  • The write_file method in debug_gym/gym/workspace.py now splits content into 32kB chunks when writing to files, ensuring compatibility with shell command length limits and supporting very large files.

Logger enhancements:

  • The debug mode in debug_gym/logger.py is now activated if the DEBUG_GYM_DEBUG environment variable matches common truthy values like "1", "true", "yes", or "on", making it more flexible and user-friendly.

Test coverage improvements:

  • The test test_write_file in tests/gym/test_workspace.py now includes checks for writing empty content and very large content (2MB), verifying that the new chunked writing logic works correctly for these edge cases.

Closes #245

@MarcCote MarcCote requested a review from matheper October 2, 2025 11:49
@MarcCote MarcCote merged commit 82e9899 into main Oct 2, 2025
11 checks passed
@MarcCote MarcCote deleted the long_command branch October 2, 2025 13:44
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.

Deal with long bash command

4 participants