Docker Code Exec delete temp files#6211
Merged
husseinmozannar merged 3 commits intomainfrom Apr 6, 2025
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6211 +/- ##
=======================================
Coverage 77.25% 77.25%
=======================================
Files 200 200
Lines 14246 14255 +9
=======================================
+ Hits 11006 11013 +7
- Misses 3240 3242 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ekzhu
approved these changes
Apr 6, 2025
Contributor
ekzhu
left a comment
There was a problem hiding this comment.
Note that the default work directory of all code executors is already temp directory from tempfile.
peterj
added a commit
to kagent-dev/autogen
that referenced
this pull request
Apr 11, 2025
* upstream/main: (120 commits) Update discover.md with adding email agent package (microsoft#6274) Expose TCM TypedDict classes for apps to use (microsoft#6269) Fix publish_message-method() notes (microsoft#6250) Fix ValueError: Dataclass has a union type error (microsoft#6266) [Bugfix] Fix for Issue microsoft#6241 - ChromaDB removed IncludeEnum (microsoft#6260) Add note on ModelInfo for Gemini Models (microsoft#6259) .NET update autogen 0.2.2 -> autogen 0.2.3 (microsoft#6257) [Draft] Enable File Upload/Paste as Task in AGS (microsoft#6091) Bugfix/azure ai search embedding (microsoft#6248) Expose more Task-Centric Memory parameters (microsoft#6246) fix: typo in usage.md (microsoft#6245) .NET update oai and aoai package version (microsoft#6239) Fix sha256_hash docstring (microsoft#6236) Update json_schema_to_pydantic version and make relaxed requirement on arry item. (microsoft#6209) Fix terminations conditions. (microsoft#6229) Docker Code Exec delete temp files (microsoft#6211) clean codes notes for autogen-core. (microsoft#6218) Fix/transformer aware any modelfamily (microsoft#6213) chore: Add powershell path check for code executor (microsoft#6212) added: gemini 2.5 pro preview (microsoft#6226) ... Signed-off-by: Peter Jausovec <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to the
DockerCommandLineCodeExecutorclass, which allows temporary files generated by code execution to be deleted after code execution. The most important changes include adding a new configuration option, updating the class to handle this option, and adding tests to verify the new functionality.New Feature: Temporary File Deletion
python/packages/autogen-ext/src/autogen_ext/code_executors/docker/_docker_code_executor.py: Addeddelete_tmp_filesattribute to theDockerCommandLineCodeExecutorConfigclass and updated theDockerCommandLineCodeExecutorclass to handle this attribute. This includes initializing the attribute, adding it to the configuration methods, and implementing the file deletion logic in the_execute_code_dont_check_setupmethod. [1] [2] [3] [4] [5] [6] [7] [8]Testing
python/packages/autogen-ext/tests/code_executors/test_docker_commandline_code_executor.py: Added a new testtest_delete_tmp_filesto verify the behavior of thedelete_tmp_filesattribute. This test checks that temporary files are correctly deleted or retained based on the configuration.