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

Only take subclasses of AutoGPTPluginTemplate as plugins #4345

Conversation

ppetermann
Copy link
Contributor

this fixes #4215, and is a re-submission of #4217 where i managed to screw up the history of the PR.

Background

limit plugin detection to classes that implement AutoGPTPluginTemplate (have it as parent),
solving #4215

Changes

added check to scan_plugin

Test Plan

create empty plugin, add class triggering old detection -> run = only real plugins detected

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

@vercel
Copy link

vercel bot commented May 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2023 3:40am

@ppetermann ppetermann marked this pull request as ready for review May 22, 2023 04:59
@ppetermann ppetermann changed the title Ppetermann/plugin detection improvement fix history only take classes as plugins that have AutoGPTPluginTemplate as a parent May 22, 2023
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (cfdb24e) 70.77% compared to head (a12d5d9) 70.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4345   +/-   ##
=======================================
  Coverage   70.77%   70.77%           
=======================================
  Files          68       68           
  Lines        3326     3326           
  Branches      532      532           
=======================================
  Hits         2354     2354           
  Misses        795      795           
  Partials      177      177           
Impacted Files Coverage Δ
autogpt/plugins/__init__.py 73.54% <100.00%> (ø)

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

@ntindle ntindle self-assigned this May 23, 2023
@ntindle ntindle added bug Something isn't working function: plugins labels May 23, 2023
@vercel vercel bot temporarily deployed to Preview May 23, 2023 00:54 Inactive
@ntindle ntindle added this to the v0.4.1 Release milestone May 25, 2023
@vercel
Copy link

vercel bot commented May 25, 2023

Deployment failed with the following error:

Resource is limited - try again in 19 minutes (more than 100, code: "api-deployments-free-per-day").

@vercel vercel bot temporarily deployed to Preview May 30, 2023 06:48 Inactive
@vercel
Copy link

vercel bot commented Jun 7, 2023

Deployment failed with the following error:

Resource is limited - try again in 9 hours (more than 100, code: "api-deployments-free-per-day").

@ntindle ntindle added the ready-for-maintainer Catalyst has decided this PR looks ready for a maintainer to merge label Jun 7, 2023
@vercel
Copy link

vercel bot commented Jun 7, 2023

Deployment failed with the following error:

Resource is limited - try again in 8 hours (more than 100, code: "api-deployments-free-per-day").

@vercel
Copy link

vercel bot commented Jun 7, 2023

Deployment failed with the following error:

Resource is limited - try again in 7 hours (more than 100, code: "api-deployments-free-per-day").

ntindle
ntindle previously requested changes Jun 7, 2023
autogpt/plugins.py Outdated Show resolved Hide resolved
@ntindle ntindle removed the ready-for-maintainer Catalyst has decided this PR looks ready for a maintainer to merge label Jun 7, 2023
@vercel vercel bot temporarily deployed to Preview June 10, 2023 03:40 Inactive
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Jun 14, 2023
@github-actions
Copy link
Contributor

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

@lc0rp lc0rp modified the milestones: v0.4.1 Release, v0.4.2 Release Jun 14, 2023
@netlify
Copy link

netlify bot commented Jun 21, 2023

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit a12d5d9
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6499e273126218000870d98b

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Jun 21, 2023
@github-actions
Copy link
Contributor

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

@lc0rp lc0rp requested a review from ntindle June 21, 2023 08:42
autogpt/plugins/__init__.py Outdated Show resolved Hide resolved
@lc0rp lc0rp requested review from lc0rp and removed request for ntindle June 26, 2023 19:21
Copy link
Contributor

@lc0rp lc0rp left a comment

Choose a reason for hiding this comment

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

Changes made in subsequent commits.

@lc0rp lc0rp dismissed ntindle’s stale review June 26, 2023 19:24

The changes were made in a subsequent commit

@lc0rp lc0rp changed the title only take classes as plugins that have AutoGPTPluginTemplate as a parent Only take subclasses of AutoGPTPluginTemplate as plugins Jun 26, 2023
@lc0rp lc0rp merged commit 9e99db1 into Significant-Gravitas:master Jun 26, 2023
break

if is_plugin and a_module.__name__ != "AutoGPTPluginTemplate":
if issubclass(a_module, AutoGPTPluginTemplate) and a_module.__name__ != "AutoGPTPluginTemplate":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

my python might mislead me here, but doesn't this mean the class needs to exist as such? the class is currently a dependency of the plugins not a part of autogpt itself, (currently its listed in the dev-dependencies in requirements.txt, this change makes it a runtime dependency if i'm not mistaken)

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/m
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

scan_plugin currently will assume any class that has an _abc_impl is a plugin
4 participants