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

Fix plugin loading issues #4888

Merged
merged 11 commits into from
Jul 5, 2023

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Jul 5, 2023

Background

  • Legacy config parameters ALLOWLISTED_PLUGINS and DENYLISTED_PLUGINS do not currently work, because Config is initialized (and therewith an empty plugins_config.yaml is created) before those config variables are loaded from .env.
  • --install-plugin-deps can fail, because install_plugin_dependencies() assumes that the first named item in an archive is the base folder, which it isn't always.

Changes

  • Run config.model_post_init() at the end of Configurable.build_agent_configuration instead of in Config.__init__, to make sure .env has been loaded before proceeding to model init (including PluginsConfig.load_config(config))
  • Add debug logging to install_plugin_dependencies()
  • Change the way install_plugin_dependencies() looks for requirements files in zipped plugins

Documentation

Test Plan

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes.
  • I have run the following commands against my code to ensure it passes our linters:
    black .
    isort .
    mypy
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring autogpt tests --in-place

@netlify
Copy link

netlify bot commented Jul 5, 2023

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 3cc8863
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/64a5f25bf6c5ea000862a11d

@github-actions github-actions bot added the size/m label Jul 5, 2023
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Patch coverage: 92.00% and project coverage change: +0.14 🎉

Comparison is base (0c8288b) 49.90% compared to head (3cc8863) 50.05%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4888      +/-   ##
==========================================
+ Coverage   49.90%   50.05%   +0.14%     
==========================================
  Files         116      116              
  Lines        4813     4799      -14     
  Branches      649      643       -6     
==========================================
  Hits         2402     2402              
+ Misses       2226     2218       -8     
+ Partials      185      179       -6     
Impacted Files Coverage Δ
autogpt/config/config.py 79.13% <81.81%> (+4.47%) ⬆️
autogpt/plugins/plugins_config.py 85.96% <100.00%> (+7.63%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Pwuts Pwuts requested a review from NeonN3mesis July 5, 2023 17:54
@Pwuts Pwuts self-assigned this Jul 5, 2023
@Pwuts Pwuts added this to the v0.4.4 Release milestone Jul 5, 2023
@Pwuts Pwuts added bug Something isn't working function: plugins labels Jul 5, 2023
@Pwuts Pwuts marked this pull request as ready for review July 5, 2023 19:15
@Pwuts Pwuts requested a review from collijk as a code owner July 5, 2023 19:15
@Pwuts Pwuts force-pushed the plugins/fix-loading-and-init branch from 24125dd to c1beebd Compare July 5, 2023 19:37
@github-actions github-actions bot added size/l and removed size/m labels Jul 5, 2023
@Pwuts Pwuts merged commit 9cf3501 into Significant-Gravitas:master Jul 5, 2023
@Pwuts Pwuts deleted the plugins/fix-loading-and-init branch July 5, 2023 23:05
dayofthedave pushed a commit to dayofthedave/Auto-GPT that referenced this pull request Jul 17, 2023
* Fix Config model initialization

* Fix basedir determination in install_plugin_dependencies

* Add logging to install_plugin_dependencies()

---------

Co-authored-by: collijk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working function: plugins size/l
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants