Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(agent): Introduce Python code execution as prompt strategy #7142

Closed
wants to merge 58 commits into from

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented May 10, 2024

Background

Add support for executing agent steps by running Python code. This allows for more complicated composite function calls within each step of agent execution.

Related:

Changes 🏗️

  • Introduced a new PromptStrategy: CodeFlowAgentPromptStrategy under code_flow.py
  • Introduced a new utils.function package that handle a python code validation that utilize ruff & pyRight as the validation engines.
  • Set CodeFlowAgentPromptStrategy as the existing default strategy.

PR Quality Scorecard ✨

  • Have you used the PR description template?   +2 pts
  • Is your pull request atomic, focusing on a single change?   +5 pts
  • Have you linked the GitHub issue(s) that this PR addresses?   +5 pts
  • Have you documented your changes clearly and comprehensively?   +5 pts
  • Have you changed or added a feature?   -4 pts
    • Have you added/updated corresponding documentation?   +4 pts
    • Have you added/updated corresponding integration tests?   +5 pts
  • Have you changed the behavior of AutoGPT?   -5 pts
    • Have you also run agbenchmark to verify that these changes do not regress performance?   +10 pts

Copy link

netlify bot commented May 10, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 7e0b115
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/66a01da0e71dbb00088e48ec

Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 45.45455% with 162 lines in your changes missing coverage. Please review.

Project coverage is 53.43%. Comparing base (e7885f9) to head (7e0b115).
Report is 368 commits behind head on master.

Files with missing lines Patch % Lines
forge/forge/command/decorator.py 23.63% 40 Missing and 2 partials ⚠️
forge/forge/models/json_schema.py 24.52% 40 Missing ⚠️
...omponents/code_flow_executor/code_flow_executor.py 0.00% 29 Missing ⚠️
...ogpt/autogpt/agents/prompt_strategies/code_flow.py 89.47% 6 Missing and 4 partials ⚠️
autogpt/autogpt/app/main.py 0.00% 10 Missing ⚠️
forge/forge/command/command.py 57.89% 7 Missing and 1 partial ⚠️
autogpt/autogpt/app/agent_protocol_server.py 0.00% 6 Missing ⚠️
autogpt/autogpt/agents/agent.py 28.57% 5 Missing ⚠️
forge/forge/llm/providers/schema.py 37.50% 5 Missing ⚠️
...togpt/autogpt/agents/prompt_strategies/one_shot.py 66.66% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7142      +/-   ##
==========================================
- Coverage   53.79%   53.43%   -0.36%     
==========================================
  Files         124      127       +3     
  Lines        7027     7293     +266     
  Branches      911      967      +56     
==========================================
+ Hits         3780     3897     +117     
- Misses       3114     3258     +144     
- Partials      133      138       +5     
Flag Coverage Δ
Linux 53.20% <45.45%> (-0.35%) ⬇️
Windows 53.10% <25.43%> (+2.69%) ⬆️
autogpt-agent 37.69% <73.38%> (+3.60%) ⬆️
forge 56.99% <25.43%> (-1.01%) ⬇️
macOS 52.54% <45.45%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ntindle
Copy link
Member

ntindle commented May 10, 2024

Should this be in forge??

Copy link

codiumai-pr-agent-pro bot commented May 10, 2024

CI Failure Feedback 🧐

(Checks updated until commit e204491)

Action: test (3.10, windows)

Failed stage: Run pytest with coverage [❌]

Failed test name: test_code_flow_parse_response

Failure summary:

The action failed due to two specific tests encountering a PermissionError:

  • test_code_flow_parse_response in tests/unit/test_code_flow_strategy.py failed because the process
    could not access the temporary file tmp5lemyeit.py as it was being used by another process.
  • test_code_validation in tests/unit/test_function_code_validation.py failed because the process could
    not access the temporary file tmpij9z4v7r.py as it was being used by another process.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Microsoft Windows Server 2022
    ...
    
    575:  plugins: anyio-4.2.0, asyncio-0.21.1, benchmark-4.0.0, cov-4.1.0, integration-0.2.3, mock-3.12.0, recording-0.13.1, xdist-3.5.0
    576:  asyncio: mode=strict
    577:  created: 4/4 workers
    578:  4 workers [230 items]
    579:  scheduling tests via LoadScheduling
    580:  tests/unit/test_code_flow_strategy.py::test_code_flow_build_prompt 
    581:  tests/unit/test_json.py::test_json_loads_fixable[fixable_json13] 
    582:  tests/unit/test_json.py::test_json_loads_unfixable[unfixable_json5] 
    583:  tests/unit/test_git_commands.py::test_clone_repository_error 
    ...
    
    614:  [gw2] [  6%] PASSED tests/unit/test_json.py::test_json_loads_unfixable[unfixable_json3] 
    615:  tests/unit/test_json.py::test_json_loads_unfixable[unfixable_json4] 
    616:  [gw2] [  7%] PASSED tests/unit/test_json.py::test_json_loads_unfixable[unfixable_json4] 
    617:  tests/unit/test_local_file_storage.py::test_rename[file_path2] 
    618:  [gw3] [  7%] PASSED tests/unit/test_local_file_storage.py::test_open_file[file_path1] 
    619:  tests/unit/test_local_file_storage.py::test_open_file[file_path2] 
    620:  [gw2] [  8%] PASSED tests/unit/test_local_file_storage.py::test_rename[file_path2] 
    621:  tests/unit/test_local_file_storage.py::test_rename[file_path3] 
    622:  [gw1] [  8%] PASSED tests/unit/test_git_commands.py::test_clone_repository_error 
    ...
    
    658:  [gw2] [ 16%] PASSED tests/unit/test_local_file_storage.py::test_rename[file_path3] 
    659:  tests/unit/test_local_file_storage.py::test_clone_with_subroot 
    660:  [gw1] [ 16%] PASSED tests/unit/test_local_file_storage.py::test_get_path_inaccessible[inaccessible_path2] 
    661:  tests/unit/test_local_file_storage.py::test_get_path_inaccessible[inaccessible_path3] 
    662:  [gw2] [ 17%] PASSED tests/unit/test_local_file_storage.py::test_clone_with_subroot 
    663:  tests/unit/test_local_file_storage.py::test_get_path_accessible[accessible_path0] 
    664:  [gw1] [ 17%] PASSED tests/unit/test_local_file_storage.py::test_get_path_inaccessible[inaccessible_path3] 
    665:  tests/unit/test_local_file_storage.py::test_get_path_inaccessible[inaccessible_path4] 
    666:  [gw0] [ 18%] FAILED tests/unit/test_code_flow_strategy.py::test_code_flow_parse_response 
    ...
    
    707:  tests/unit/test_local_file_storage.py::test_get_path_accessible[accessible_path7] 
    708:  [gw1] [ 27%] PASSED tests/unit/test_local_file_storage.py::test_get_path_inaccessible[inaccessible_path11] 
    709:  tests/unit/test_logs.py::test_remove_color_codes[\x1b[36mHello,\x1b[32m World!-Hello, World!] 
    710:  [gw3] [ 27%] PASSED tests/unit/test_local_file_storage.py::test_exists_delete_file[file_path2] 
    711:  [gw2] [ 28%] PASSED tests/unit/test_local_file_storage.py::test_get_path_accessible[accessible_path7] 
    712:  tests/unit/test_local_file_storage.py::test_get_path_inaccessible[inaccessible_path0] 
    713:  tests/unit/test_local_file_storage.py::test_exists_delete_file[file_path3] 
    714:  [gw1] [ 28%] PASSED tests/unit/test_logs.py::test_remove_color_codes[\x1b[36mHello,\x1b[32m World!-Hello, World!] 
    715:  tests/unit/test_logs.py::test_remove_color_codes[\x1b[1m\x1b[31mError:\x1b[0m\x1b[31m file not found-Error: file not found] 
    716:  [gw1] [ 29%] PASSED tests/unit/test_logs.py::test_remove_color_codes[\x1b[1m\x1b[31mError:\x1b[0m\x1b[31m file not found-Error: file not found] 
    ...
    
    768:  [gw3] [ 40%] PASSED tests/unit/test_logs.py::test_remove_color_codes[hello-hello] 
    769:  tests/unit/test_logs.py::test_remove_color_codes[hello\x1b[31m world-hello world] 
    770:  [gw2] [ 40%] PASSED tests/unit/test_url_validation.py::test_url_validation_succeeds[http://google.com/] 
    771:  [gw3] [ 41%] PASSED tests/unit/test_logs.py::test_remove_color_codes[hello\x1b[31m world-hello world] 
    772:  tests/unit/test_url_validation.py::test_url_validation_succeeds[http://a.lot.of.domain.net/param1/param2] 
    773:  tests/unit/test_url_validation.py::test_happy_path_valid_url 
    774:  [gw2] [ 41%] PASSED tests/unit/test_url_validation.py::test_url_validation_succeeds[http://a.lot.of.domain.net/param1/param2] 
    775:  [gw3] [ 42%] PASSED tests/unit/test_url_validation.py::test_happy_path_valid_url 
    776:  tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[htt://example.com-Invalid URL format] 
    777:  tests/unit/test_url_validation.py::test_general_behavior_additional_path_parameters_query_string 
    778:  [gw3] [ 42%] PASSED tests/unit/test_url_validation.py::test_general_behavior_additional_path_parameters_query_string 
    779:  [gw2] [ 43%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[htt://example.com-Invalid URL format] 
    780:  tests/unit/test_url_validation.py::test_edge_case_missing_scheme_or_network_location 
    781:  tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[httppp://example.com-Invalid URL format] 
    782:  [gw3] [ 43%] PASSED tests/unit/test_url_validation.py::test_edge_case_missing_scheme_or_network_location 
    783:  tests/unit/test_url_validation.py::test_edge_case_local_file_access 
    784:  [gw2] [ 43%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[httppp://example.com-Invalid URL format] 
    785:  tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[ https://example.com-Invalid URL format] 
    786:  [gw3] [ 44%] PASSED tests/unit/test_url_validation.py::test_edge_case_local_file_access 
    787:  tests/unit/test_url_validation.py::test_general_behavior_sanitizes_url 
    788:  [gw2] [ 44%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[ https://example.com-Invalid URL format] 
    789:  tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[http://?query=q-Missing Scheme or Network location] 
    790:  [gw3] [ 45%] PASSED tests/unit/test_url_validation.py::test_general_behavior_sanitizes_url 
    791:  [gw2] [ 45%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_invalid_url[http://?query=q-Missing Scheme or Network location] 
    792:  tests/unit/test_url_validation.py::test_general_behavior_invalid_url_format 
    793:  tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file://localhost] 
    794:  [gw3] [ 46%] PASSED tests/unit/test_url_validation.py::test_general_behavior_invalid_url_format 
    795:  [gw2] [ 46%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file://localhost] 
    796:  tests/unit/test_url_validation.py::test_url_with_special_chars 
    797:  tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file://localhost/home/reinier/secrets.txt] 
    798:  [gw3] [ 46%] PASSED tests/unit/test_url_validation.py::test_url_with_special_chars 
    799:  [gw2] [ 47%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file://localhost/home/reinier/secrets.txt] 
    800:  tests/unit/test_url_validation.py::test_extremely_long_url 
    801:  tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file:///home/reinier/secrets.txt] 
    802:  [gw3] [ 47%] PASSED tests/unit/test_url_validation.py::test_extremely_long_url 
    803:  [gw2] [ 48%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file:///home/reinier/secrets.txt] 
    804:  tests/unit/test_url_validation.py::test_internationalized_url 
    805:  tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file:///C:/Users/Reinier/secrets.txt] 
    806:  [gw3] [ 48%] PASSED tests/unit/test_url_validation.py::test_internationalized_url 
    807:  [gw2] [ 49%] PASSED tests/unit/test_url_validation.py::test_url_validation_fails_local_path[file:///C:/Users/Reinier/secrets.txt] 
    808:  tests/unit/test_utils.py::test_get_current_git_branch 
    809:  tests/unit/test_utils.py::test_get_bulletin_from_web_success 
    810:  [gw2] [ 49%] SKIPPED tests/unit/test_utils.py::test_get_current_git_branch 
    811:  [gw0] [ 50%] PASSED tests/unit/test_file_operations.py::test_read_file_not_found 
    812:  tests/unit/test_utils.py::test_get_current_git_branch_success 
    813:  tests/unit/test_file_operations.py::test_write_to_file_relative_path 
    814:  [gw3] [ 50%] PASSED tests/unit/test_utils.py::test_get_bulletin_from_web_success 
    815:  [gw2] [ 50%] PASSED tests/unit/test_utils.py::test_get_current_git_branch_success 
    816:  tests/unit/test_utils.py::test_get_bulletin_from_web_failure 
    817:  tests/unit/test_utils.py::test_get_current_git_branch_failure 
    818:  [gw3] [ 51%] PASSED tests/unit/test_utils.py::test_get_bulletin_from_web_failure 
    819:  [gw2] [ 51%] PASSED tests/unit/test_utils.py::test_get_current_git_branch_failure 
    ...
    
    851:  tests/unit/test_file_operations.py::test_list_files 
    852:  [gw2] [ 58%] PASSED tests/unit/test_web_search.py::test_google_search[test-1-expected_output_parts0-return_value0] 
    853:  tests/unit/test_web_search.py::test_google_search[-1-expected_output_parts1-return_value1] 
    854:  [gw0] [ 59%] PASSED tests/unit/test_file_operations.py::test_list_files 
    855:  tests/unit/test_function_code_validation.py::test_code_validation 
    856:  [gw2] [ 59%] PASSED tests/unit/test_web_search.py::test_google_search[-1-expected_output_parts1-return_value1] 
    857:  tests/unit/test_web_search.py::test_google_search[no results-1-expected_output_parts2-return_value2] 
    858:  [gw3] [ 60%] PASSED tests/unit/test_web_search.py::test_google_official_search[-3-search_results1-expected_output1] 
    859:  tests/unit/test_web_search.py::test_google_official_search_errors[invalid query-3-HttpError-400-Invalid Value] 
    860:  [gw3] [ 60%] PASSED tests/unit/test_web_search.py::test_google_official_search_errors[invalid query-3-HttpError-400-Invalid Value] 
    861:  tests/unit/test_web_search.py::test_google_official_search_errors[invalid API key-3-ConfigurationError-403-invalid API key] 
    862:  [gw0] [ 60%] FAILED tests/unit/test_function_code_validation.py::test_code_validation 
    863:  tests/unit/test_git_commands.py::test_clone_auto_gpt_repository 
    864:  [gw3] [ 61%] PASSED tests/unit/test_web_search.py::test_google_official_search_errors[invalid API key-3-ConfigurationError-403-invalid API key] 
    ...
    
    907:  tests/unit/test_text_file_parsers.py::test_parsers[.txt-mock_text_file] 
    908:  [gw1] [ 70%] PASSED tests/unit/test_text_file_parsers.py::test_parsers[.txt-mock_text_file] 
    909:  tests/unit/test_text_file_parsers.py::test_parsers[.csv-mock_csv_file] 
    910:  [gw1] [ 71%] PASSED tests/unit/test_text_file_parsers.py::test_parsers[.csv-mock_csv_file] 
    911:  tests/unit/test_text_file_parsers.py::test_parsers[.pdf-mock_pdf_file] 
    912:  [gw1] [ 71%] PASSED tests/unit/test_text_file_parsers.py::test_parsers[.pdf-mock_pdf_file] 
    913:  tests/unit/test_text_file_parsers.py::test_parsers[.docx-mock_docx_file] 
    914:  [gw1] [ 72%] PASSED tests/unit/test_text_file_parsers.py::test_parsers[.docx-mock_docx_file] 
    915:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-] 
    916:  [gw1] [ 72%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-] 
    917:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    918:  [gw1] [ 73%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    919:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    920:  [gw1] [ 73%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    921:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-{"error:}] 
    922:  [gw1] [ 73%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-{"error:}] 
    923:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-] 
    924:  [gw1] [ 74%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-CompVis/stable-diffusion-v1-4-] 
    925:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    926:  [gw1] [ 74%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    927:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    928:  [gw1] [ 75%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    929:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-{"error:}] 
    930:  [gw1] [ 75%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-{"error:}] 
    931:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-] 
    932:  [gw1] [ 76%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-0-stabilityai/stable-diffusion-2-1-] 
    933:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    934:  [gw1] [ 76%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    935:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    936:  [gw1] [ 76%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    937:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-{"error:}] 
    938:  [gw1] [ 77%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-{"error:}] 
    939:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-] 
    940:  [gw1] [ 77%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-CompVis/stable-diffusion-v1-4-] 
    941:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    942:  [gw1] [ 78%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    943:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    944:  [gw1] [ 78%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    945:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-{"error:}] 
    946:  [gw1] [ 79%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-{"error:}] 
    947:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-] 
    948:  [gw1] [ 79%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-10-stabilityai/stable-diffusion-2-1-] 
    949:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    950:  [gw1] [ 80%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    951:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    952:  [gw1] [ 80%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    953:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-{"error:}] 
    954:  [gw1] [ 80%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-{"error:}] 
    955:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-] 
    956:  [gw1] [ 81%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-CompVis/stable-diffusion-v1-4-] 
    957:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    958:  [gw1] [ 81%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    959:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    960:  [gw1] [ 82%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    961:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-{"error:}] 
    962:  [gw1] [ 82%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-{"error:}] 
    963:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-] 
    964:  [gw1] [ 83%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[512-0-stabilityai/stable-diffusion-2-1-] 
    965:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    966:  [gw1] [ 83%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    967:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    968:  [gw1] [ 83%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    969:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-{"error:}] 
    970:  [gw1] [ 84%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-{"error:}] 
    971:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-] 
    972:  [gw1] [ 84%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-CompVis/stable-diffusion-v1-4-] 
    973:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    974:  [gw1] [ 85%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    975:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    976:  [gw1] [ 85%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    977:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-{"error:}] 
    978:  [gw1] [ 86%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-{"error:}] 
    979:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-] 
    980:  [gw2] [ 86%] PASSED tests/unit/test_web_search.py::test_google_search[no results-1-expected_output_parts2-return_value2] 
    981:  tests/unit/test_web_search.py::test_google_official_search[test-3-search_results0-expected_output0] 
    982:  [gw1] [ 86%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-10-stabilityai/stable-diffusion-2-1-] 
    983:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    984:  [gw2] [ 87%] PASSED tests/unit/test_web_search.py::test_google_official_search[test-3-search_results0-expected_output0] 
    985:  tests/integration/test_execute_code.py::test_execute_shell_allowlist_should_deny 
    986:  [gw1] [ 87%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    987:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    988:  [gw2] [ 88%] PASSED tests/integration/test_execute_code.py::test_execute_shell_allowlist_should_deny 
    989:  tests/integration/test_execute_code.py::test_execute_shell_allowlist_should_allow 
    990:  [gw1] [ 88%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    991:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-{"error:}] 
    992:  [gw1] [ 89%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-{"error:}] 
    993:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-] 
    994:  [gw2] [ 89%] PASSED tests/integration/test_execute_code.py::test_execute_shell_allowlist_should_allow 
    995:  tests/integration/test_image_gen.py::test_dalle[256] 
    996:  [gw1] [ 90%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-CompVis/stable-diffusion-v1-4-] 
    997:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    998:  [gw1] [ 90%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    999:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    1000:  [gw2] [ 90%] PASSED tests/integration/test_image_gen.py::test_dalle[256] 
    1001:  tests/integration/test_image_gen.py::test_dalle[512] 
    1002:  [gw1] [ 91%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    1003:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-{"error:}] 
    1004:  [gw1] [ 91%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-{"error:}] 
    1005:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-] 
    1006:  [gw2] [ 92%] PASSED tests/integration/test_image_gen.py::test_dalle[512] 
    1007:  tests/integration/test_image_gen.py::test_dalle[1024] 
    1008:  [gw1] [ 92%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[1024-0-stabilityai/stable-diffusion-2-1-] 
    1009:  tests/integration/test_image_gen.py::test_huggingface_fail_request_no_delay 
    1010:  [gw1] [ 93%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_no_delay 
    1011:  tests/integration/test_image_gen.py::test_huggingface_fail_request_bad_image 
    1012:  [gw1] [ 93%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_bad_image 
    1013:  tests/integration/test_setup.py::test_apply_overrides_to_ai_settings 
    1014:  [gw1] [ 93%] PASSED tests/integration/test_setup.py::test_apply_overrides_to_ai_settings 
    1015:  tests/integration/test_setup.py::test_interactively_revise_ai_settings 
    1016:  [gw2] [ 94%] PASSED tests/integration/test_image_gen.py::test_dalle[1024] 
    1017:  tests/integration/test_image_gen.py::test_huggingface_fail_request_bad_json 
    1018:  [gw1] [ 94%] PASSED tests/integration/test_setup.py::test_interactively_revise_ai_settings 
    1019:  tests/integration/test_web_selenium.py::test_browse_website_nonexistent_url 
    1020:  [gw2] [ 95%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_bad_json 
    1021:  [gw3] [ 95%] XFAIL tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[512] 
    1022:  tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[1024] 
    1023:  [gw0] [ 96%] XFAIL tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[256] 
    1024:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-] 
    1025:  [gw0] [ 96%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-] 
    1026:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    1027:  [gw0] [ 96%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    1028:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    1029:  [gw0] [ 97%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-{"error":"Model [model] is currently loading"}] 
    1030:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-{"error:}] 
    1031:  [gw0] [ 97%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-{"error:}] 
    1032:  [gw3] [ 98%] XFAIL tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[1024] 
    1033:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    1034:  [gw3] [ 98%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading","estimated_time": [delay]}] 
    1035:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    1036:  [gw3] [ 99%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-{"error":"Model [model] is currently loading"}] 
    1037:  tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-{"error:}] 
    1038:  [gw3] [ 99%] PASSED tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-CompVis/stable-diffusion-v1-4-{"error:}] 
    1039:  [gw1] [100%] PASSED tests/integration/test_web_selenium.py::test_browse_website_nonexistent_url 
    1040:  ================================== FAILURES ===================================
    1041:  ________________________ test_code_flow_parse_response ________________________
    1042:  [gw0] win32 -- Python 3.10.11 C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\agpt-mKrjTX_b-py3.10\Scripts\python.exe
    1043:  command_arguments = ['ruff', 'check', '--fix', '--ignore', 'F841', '--ignore', ...]
    1044:  file_contents = "#------Code-Start------#\n\n\n\n\n\n\nasync def main() -> str:\n    return 'You passed the test.'"
    1045:  suffix = '.py', output_type = <OutputType.BOTH: 'both'>
    1046:  raise_file_contents_on_error = True
    1047:  async def exec_external_on_contents(
    1048:  command_arguments: list[str],
    1049:  file_contents,
    1050:  suffix: str = ".py",
    1051:  output_type: OutputType = OutputType.BOTH,
    1052:  raise_file_contents_on_error: bool = False,
    ...
    
    1063:  the command. There is no need to provide the file path as an argument, as it will
    1064:  be appended to the command arguments.
    1065:  Example:
    1066:  exec_external(["ruff", "check"], "print('Hello World')")
    1067:  will run the command "ruff check <temp_file_path>" with the file contents
    1068:  "print('Hello World')" and return the file contents after the command
    1069:  has been executed.
    1070:  """
    1071:  errors = ""
    1072:  if len(command_arguments) == 0:
    1073:  raise ExecError("No command arguments provided")
    ...
    
    1095:  protocol = <SubprocessStreamProtocol>
    1096:  args = ('ruff', 'check', '--fix', '--ignore', 'F841', '--ignore', ...)
    1097:  shell = False, stdin = None, stdout = -1, stderr = -1, bufsize = 0, extra = None
    1098:  kwargs = {}
    1099:  async def _make_subprocess_transport(self, protocol, args, shell,
    1100:  stdin, stdout, stderr, bufsize,
    1101:  extra=None, **kwargs):
    1102:  """Create subprocess transport."""
    1103:  >       raise NotImplementedError
    1104:  E       NotImplementedError
    1105:  C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\asyncio\base_events.py:498: NotImplementedError
    ...
    
    1128:  >       response = await CodeFlowAgentPromptStrategy(config, logger).parse_response_content(
    1129:  AssistantChatMessage(content=response_content)
    1130:  )
    1131:  tests\unit\test_code_flow_strategy.py:97: 
    1132:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    1133:  autogpt\agents\prompt_strategies\code_flow.py:293: in parse_response_content
    1134:  code_validation = await CodeValidator(
    1135:  ..\forge\forge\utils\function\code_validation.py:203: in validate_code
    1136:  validation_errors.extend(await static_code_analysis(result))
    1137:  ..\forge\forge\utils\function\code_validation.py:272: in static_code_analysis
    1138:  validation_errors += await __execute_ruff(func)
    1139:  ..\forge\forge\utils\function\code_validation.py:297: in __execute_ruff
    1140:  code = await exec_external_on_contents(
    1141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    1142:  command_arguments = ['ruff', 'check', '--fix', '--ignore', 'F841', '--ignore', ...]
    1143:  file_contents = "#------Code-Start------#\n\n\n\n\n\n\nasync def main() -> str:\n    return 'You passed the test.'"
    1144:  suffix = '.py', output_type = <OutputType.BOTH: 'both'>
    1145:  raise_file_contents_on_error = True
    1146:  async def exec_external_on_contents(
    1147:  command_arguments: list[str],
    1148:  file_contents,
    1149:  suffix: str = ".py",
    1150:  output_type: OutputType = OutputType.BOTH,
    1151:  raise_file_contents_on_error: bool = False,
    ...
    
    1162:  the command. There is no need to provide the file path as an argument, as it will
    1163:  be appended to the command arguments.
    1164:  Example:
    1165:  exec_external(["ruff", "check"], "print('Hello World')")
    1166:  will run the command "ruff check <temp_file_path>" with the file contents
    1167:  "print('Hello World')" and return the file contents after the command
    1168:  has been executed.
    1169:  """
    1170:  errors = ""
    1171:  if len(command_arguments) == 0:
    1172:  raise ExecError("No command arguments provided")
    ...
    
    1183:  stdout=subprocess.PIPE,
    1184:  stderr=subprocess.PIPE,
    1185:  )
    1186:  result = await r.communicate()
    1187:  stdout, stderr = result[0].decode("utf-8"), result[1].decode("utf-8")
    1188:  logger.debug(f"Output: {stdout}")
    1189:  if temp_file_path in stdout:
    1190:  stdout = stdout  # .replace(temp_file.name, "/generated_file")
    1191:  logger.debug(f"Errors: {stderr}")
    1192:  if output_type == OutputType.STD_OUT:
    1193:  errors = stdout
    1194:  elif output_type == OutputType.STD_ERR:
    1195:  errors = stderr
    1196:  else:
    1197:  errors = stdout + "\n" + stderr
    1198:  with open(temp_file_path, "r") as f:
    1199:  file_contents = f.read()
    1200:  finally:
    1201:  # Ensure the temporary file is deleted
    1202:  >               os.remove(temp_file_path)
    1203:  E               PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmp5lemyeit.py'
    1204:  ..\forge\forge\utils\function\exec.py:90: PermissionError
    1205:  ____________________________ test_code_validation _____________________________
    1206:  [gw0] win32 -- Python 3.10.11 C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\agpt-mKrjTX_b-py3.10\Scripts\python.exe
    1207:  command_arguments = ['ruff', 'check', '--fix', '--ignore', 'F841', '--ignore', ...]
    1208:  file_contents = '#------Code-Start------#\n\n\n\n\nasync def read_webpage(url: str, query: str) -> str: # type: ignore\n    """\n    R... crawl_info(url, query)\n        if info:\n            return info\n    x = await hehe()\n    return \'No info found\''
    1209:  suffix = '.py', output_type = <OutputType.BOTH: 'both'>
    1210:  raise_file_contents_on_error = True
    1211:  async def exec_external_on_contents(
    1212:  command_arguments: list[str],
    1213:  file_contents,
    1214:  suffix: str = ".py",
    1215:  output_type: OutputType = OutputType.BOTH,
    1216:  raise_file_contents_on_error: bool = False,
    ...
    
    1227:  the command. There is no need to provide the file path as an argument, as it will
    1228:  be appended to the command arguments.
    1229:  Example:
    1230:  exec_external(["ruff", "check"], "print('Hello World')")
    1231:  will run the command "ruff check <temp_file_path>" with the file contents
    1232:  "print('Hello World')" and return the file contents after the command
    1233:  has been executed.
    1234:  """
    1235:  errors = ""
    1236:  if len(command_arguments) == 0:
    1237:  raise ExecError("No command arguments provided")
    ...
    
    1259:  protocol = <SubprocessStreamProtocol>
    1260:  args = ('ruff', 'check', '--fix', '--ignore', 'F841', '--ignore', ...)
    1261:  shell = False, stdin = None, stdout = -1, stderr = -1, bufsize = 0, extra = None
    1262:  kwargs = {}
    1263:  async def _make_subprocess_transport(self, protocol, args, shell,
    1264:  stdin, stdout, stderr, bufsize,
    1265:  extra=None, **kwargs):
    1266:  """Create subprocess transport."""
    1267:  >       raise NotImplementedError
    1268:  E       NotImplementedError
    1269:  C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\asyncio\base_events.py:498: NotImplementedError
    ...
    
    1329:  x = await hehe()
    1330:  return "No info found"
    1331:  """,
    1332:  packages=[],
    1333:  )
    1334:  tests\unit\test_function_code_validation.py:43: 
    1335:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    1336:  ..\forge\forge\utils\function\code_validation.py:203: in validate_code
    1337:  validation_errors.extend(await static_code_analysis(result))
    1338:  ..\forge\forge\utils\function\code_validation.py:272: in static_code_analysis
    1339:  validation_errors += await __execute_ruff(func)
    1340:  ..\forge\forge\utils\function\code_validation.py:297: in __execute_ruff
    1341:  code = await exec_external_on_contents(
    1342:  Setting random seed to 42
    1343:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    1344:  command_arguments = ['ruff', 'check', '--fix', '--ignore', 'F841', '--ignore', ...]
    1345:  file_contents = '#------Code-Start------#\n\n\n\n\nasync def read_webpage(url: str, query: str) -> str: # type: ignore\n    """\n    R... crawl_info(url, query)\n        if info:\n            return info\n    x = await hehe()\n    return \'No info found\''
    1346:  suffix = '.py', output_type = <OutputType.BOTH: 'both'>
    1347:  raise_file_contents_on_error = True
    1348:  async def exec_external_on_contents(
    1349:  command_arguments: list[str],
    1350:  file_contents,
    1351:  suffix: str = ".py",
    1352:  output_type: OutputType = OutputType.BOTH,
    1353:  raise_file_contents_on_error: bool = False,
    ...
    
    1364:  the command. There is no need to provide the file path as an argument, as it will
    1365:  be appended to the command arguments.
    1366:  Example:
    1367:  exec_external(["ruff", "check"], "print('Hello World')")
    1368:  will run the command "ruff check <temp_file_path>" with the file contents
    1369:  "print('Hello World')" and return the file contents after the command
    1370:  has been executed.
    1371:  """
    1372:  errors = ""
    1373:  if len(command_arguments) == 0:
    1374:  raise ExecError("No command arguments provided")
    ...
    
    1385:  stdout=subprocess.PIPE,
    1386:  stderr=subprocess.PIPE,
    1387:  )
    1388:  result = await r.communicate()
    1389:  stdout, stderr = result[0].decode("utf-8"), result[1].decode("utf-8")
    1390:  logger.debug(f"Output: {stdout}")
    1391:  if temp_file_path in stdout:
    1392:  stdout = stdout  # .replace(temp_file.name, "/generated_file")
    1393:  logger.debug(f"Errors: {stderr}")
    1394:  if output_type == OutputType.STD_OUT:
    1395:  errors = stdout
    1396:  elif output_type == OutputType.STD_ERR:
    1397:  errors = stderr
    1398:  else:
    1399:  errors = stdout + "\n" + stderr
    1400:  with open(temp_file_path, "r") as f:
    1401:  file_contents = f.read()
    1402:  finally:
    1403:  # Ensure the temporary file is deleted
    1404:  >               os.remove(temp_file_path)
    1405:  E               PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpij9z4v7r.py'
    1406:  ..\forge\forge\utils\function\exec.py:90: PermissionError
    ...
    
    1452:  Coverage XML written to file coverage.xml
    1453:  ============================ slowest 10 durations =============================
    1454:  37.69s call     tests/integration/test_web_selenium.py::test_browse_website_nonexistent_url
    1455:  4.10s call     tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[256]
    1456:  4.04s call     tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[512]
    1457:  4.04s call     tests/integration/test_image_gen.py::test_sd_webui_negative_prompt[1024]
    1458:  3.01s call     tests/unit/test_web_search.py::test_google_search[no results-1-expected_output_parts2-return_value2]
    1459:  1.07s call     tests/unit/test_spinner.py::test_spinner_stops_spinning
    1460:  0.27s call     tests/integration/test_image_gen.py::test_huggingface_fail_request_with_delay[256-10-stabilityai/stable-diffusion-2-1-]
    1461:  0.26s call     tests/unit/test_text_file_parsers.py::test_parsers[.pdf-mock_pdf_file]
    1462:  0.20s call     tests/unit/test_spinner.py::test_spinner_initializes_with_custom_values
    1463:  0.15s setup    tests/unit/test_web_search.py::test_google_official_search[-3-search_results1-expected_output1]
    1464:  =========================== short test summary info ===========================
    1465:  FAILED tests/unit/test_code_flow_strategy.py::test_code_flow_parse_response - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmp5lemyeit.py'
    1466:  FAILED tests/unit/test_function_code_validation.py::test_code_validation - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpij9z4v7r.py'
    1467:  ====== 2 failed, 212 passed, 6 skipped, 12 xfailed, 7 warnings in 53.54s ======
    1468:  ##[error]Process completed with exit code 1.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label May 14, 2024
    Copy link
    Contributor

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    Copy link
    Contributor

    Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label May 14, 2024
    from .base import BaseAgent, BaseAgentActionProposal
    from .prompt_strategies.one_shot import OneShotAgentActionProposal
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    OneShotAgentActionProposal is not part of .agent

    @@ -97,19 +103,20 @@ def __init__(
    llm_provider: ChatModelProvider,
    file_storage: FileStorage,
    legacy_config: Config,
    prompt_strategy_class: type[PromptStrategy] = CodeFlowAgentPromptStrategy,
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    decouple agent.py & OneShot. pass this class for custom prompt strategy

    if not parsed_response.python_code:
    raise ValueError("python_code is empty")

    available_functions = {
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    This is for the generated code validation.

    @@ -2,18 +2,21 @@
    from logging import _nameToLevel as logLevelMap
    from pathlib import Path
    from typing import Optional
    from dotenv import load_dotenv
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ignore this, for debugging purpose, will revert

    logger = logging.getLogger(__name__)


    class CodeFlowExecutionComponent(CommandProvider):
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    So... BaseAgentActionProposal use use_tool which only executes a single tool, and it's already intertwined with the agent implementation. So my approach on having this code flow execution is by returning BaseAgentActionProposal that use this newly created tool, which is basically executing python code using already existing other tools as variables.

    @@ -158,6 +159,37 @@ def fmt_line(self) -> str:
    )
    return f"{self.name}: {self.description}. Params: ({params})"

    def fmt_header(self, callable=None) -> str:
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    callable part here is unused, will revert

    @@ -443,6 +443,8 @@ async def create_chat_completion(
    if not parse_errors:
    try:
    parsed_result = completion_parser(assistant_msg)
    if isinstance(parsed_result, Coroutine):
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    So completion_parser needs to be async for the code validation, I did this instead of changing the whole usage of it to async.

    Copy link
    Contributor

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label May 15, 2024
    Copy link
    Contributor

    github-actions bot commented Jul 4, 2024

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Jul 4, 2024
    Copy link
    Contributor

    github-actions bot commented Jul 4, 2024

    Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Jul 4, 2024
    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Jul 13, 2024
    Copy link
    Contributor

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    Copy link
    Contributor

    Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Jul 23, 2024
    - Amend `main.py:update_user(..)` to improve displaying of existing + new prompt strategy output
    - Replace `"execute_code_flow"` literals with references to the command definition
    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Jul 23, 2024
    Copy link
    Contributor

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    Copy link
    Contributor

    Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Jul 23, 2024
    @ntindle
    Copy link
    Member

    ntindle commented Aug 5, 2024

    Do we have a status on this?

    Copy link
    Contributor

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Sep 20, 2024
    @aarushik93
    Copy link
    Contributor

    @majdyz can I close this PR, seems we're not working on it?

    @Pwuts
    Copy link
    Member

    Pwuts commented Oct 15, 2024

    This could be a really awesome block

    @majdyz
    Copy link
    Contributor Author

    majdyz commented Oct 16, 2024

    @aarushik93 sure I'll close it.
    @Pwuts this could be a nice block if we managed to circumvent the security vulnerability. not sure if limiting the scope & package that can be used is secure enough or it's still going to prone to ddos & CVE.

    @majdyz majdyz closed this Oct 16, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Classic AutoGPT Agent conflicts Automatically applied to PRs with merge conflicts Forge size/xl
    Projects
    Status: Done
    Development

    Successfully merging this pull request may close these issues.

    Command chaining/piping
    6 participants