camel icon indicating copy to clipboard operation
camel copied to clipboard

feat: enhance terminal toolkit

Open jjyaoao opened this issue 9 months ago • 6 comments

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-number in the PR description (required)
  • [x] I have checked if any dependencies need to be added or updated in pyproject.toml and uv 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 avatar Mar 14 '25 04:03 jjyaoao

@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

  1. Yes, it will allow it.
  2. Adding it might be better.
  3. Do you mean a method to reset the environment?

fengju0213 avatar Mar 19 '25 04:03 fengju0213

I will send a new version later with additional adaptations for Mac.

fengju0213 avatar Mar 19 '25 08:03 fengju0213

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.

fengju0213 avatar Mar 19 '25 12:03 fengju0213

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

GitHoobar avatar Mar 20 '25 13:03 GitHoobar

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.

fengju0213 avatar Mar 20 '25 15:03 fengju0213

@Wendong-Fan @fengju0213 @GitHoobar Hi, All CI have passed. You can review it again~

jjyaoao avatar Mar 31 '25 08:03 jjyaoao