feat: enhance terminal toolkit
Description
Enhance the practicability of terminal toolkit. Create a new terminal environment to run scripts and configure the environment. #1738 #1724
Checklist
Go over all the following points, and put an x in all the boxes that apply.
- [x] I have read the CONTRIBUTION guide (required)
- [x] I have linked this PR to an issue using the Development section on the right sidebar or by adding
Fixes #issue-numberin the PR description (required) - [x] I have checked if any dependencies need to be added or updated in
pyproject.tomlanduv lock - [ ] I have updated the tests accordingly (required for a bug fix or a new feature)
- [ ] I have updated the documentation if needed:
- [ ] I have added examples if this is a new feature
If you are unsure about any of these, don't hesitate to ask. We are here to help!
@jjyaoao a few question:
- Disabling safe mode allows arbitrary command execution?
- can we add process group handling?
- maybe we also need to implement proper cleanup methods
thanks! @GitHoobar
- Yes, it will allow it.
- Adding it might be better.
- Do you mean a method to reset the environment?
I will send a new version later with additional adaptations for Mac.
hi @GitHoobar i have removed some unnecessary code. And It seems that the GUI cannot be opened on macOS, so I am using a log to simulate terminal output as a replacement. Please check again.
hey @fengju0213 @jjyaoao , before I review it can you make sure to align it with our repo rules. You can find them here: https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md
hey @fengju0213 @jjyaoao , before I review it can you make sure to align it with our repo rules. You can find them here: https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md
OK,
- Pytest Gradio Apps and Examples / pytest_examples (pull_request)
thanks @GitHoobar I fixed some line length issues and resubmitted it. Additionally, the error in test_terminal_toolkit occurred because the new feature introduced safe_mode, so the error is expected. I have also updated test_terminal_toolkit accordingly.
@Wendong-Fan @fengju0213 @GitHoobar Hi, All CI have passed. You can review it again~