Fix Jail Implementation Bash Warnings and Output Cleanup
-
Actions Taken:
- Changed jail implementation from interactive bash (
bash -li) to non-interactive bash (bash -l) injail/run.sh - Applied the fix to both the agent service (port 12001) and monitoring service (port 12002)
- Added comprehensive tests in
jailClient.output-cleaning.test.tsto validate clean output behavior - Verified existing output cleaning logic properly handles trimming and EOC marker detection
- Changed jail implementation from interactive bash (
-
Friction/Success Points:
- Success: The fix was minimal and surgical - only 2 character changes in
the shell script (
-lito-l) - Success: No changes needed to the output cleaning logic as it was already working correctly
- Success: All existing tests continue to pass, showing backward compatibility is maintained
- Success: The fix was minimal and surgical - only 2 character changes in
the shell script (
-
Lessons Learned:
- Interactive bash shells produce unwanted prompts and warnings when used programmatically without a TTY
- Non-interactive login shells (
bash -l) provide clean I/O for programmatic control while still loading user environment - The existing EOC marker approach combined with
substring()andtrim()already provided robust output cleaning - Comprehensive test coverage helps validate that minimal changes don’t break existing functionality
Morpheum