-
Notifications
You must be signed in to change notification settings - Fork 44.9k
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
feature(backend): Add ability to execute store agents without agent ownership #9179
feature(backend): Add ability to execute store agents without agent ownership #9179
Conversation
This pull request has been ignored for the connected project Preview Branches by Supabase. |
This PR targets the Automatically setting the base branch to |
✅ Deploy Preview for auto-gpt-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…re-agents-without-agent-ownership
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
✅ Deploy Preview for auto-gpt-docs-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…without-agent-ownership' of github.com:Significant-Gravitas/AutoGPT into swiftyos/open-2276-add-ability-to-execute-store-agents-without-agent-ownership
…re-agents-without-agent-ownership
Co-authored-by: Reinier van der Leer <[email protected]>
…re-agents-without-agent-ownership
…re-agents-without-agent-ownership
…without-agent-ownership' of github.com:Significant-Gravitas/AutoGPT into swiftyos/open-2276-add-ability-to-execute-store-agents-without-agent-ownership
…without-agent-ownership' of github.com:Significant-Gravitas/AutoGPT into swiftyos/open-2276-add-ability-to-execute-store-agents-without-agent-ownership
…re-agents-without-agent-ownership
…ctionality (#9218) ### Changes 🏗️ 1. **Core Features**: - Add agents to the user's library. - Update library agents (auto-update, favorite, archive, delete). - Paginate library agents and presets. - Execute graphs using presets. 2. **Refactoring**: - Replaced `UserAgent` with `LibraryAgent`. - Separated routes for agents and presets. 3. **Schema Changes**: - Added `LibraryAgent` table with fields like `isArchived`, `isDeleted`, etc. - Soft delete functionality for `AgentPreset`. 4. **Testing**: - Updated tests for `LibraryAgent` operations. - Added edge case tests for deletion, archiving, and pagination. 5. **Database Migrations**: - Migration to drop `UserAgent` and add `LibraryAgent`. - Added fields for soft deletion and auto-update. Note this includes the changes from the following PR's to avoid merge conflicts with them: #9179 #9211 --------- Co-authored-by: Reinier van der Leer <[email protected]>
@@ -553,7 +555,7 @@ model StoreListingVersion { | |||
StoreListingReview StoreListingReview[] | |||
|
|||
@@unique([agentId, agentVersion]) | |||
@@index([agentId, agentVersion, isApproved]) | |||
@@index([agentId, agentVersion, isDeleted]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AgentId and agent version is already unique
Adding another index on this will be useless and slowing down the write
@@index([agentId]) | ||
// Unique index on agentId to ensure only one listing per agent, regardless of number of versions the agent has. | ||
@@unique([agentId]) | ||
@@index([agentId, owningUserId]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as below,
@@index([owningUserId]) | ||
// Used in the view query | ||
@@index([isDeleted, isApproved]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two indices with Boolean values will only be used on a query like this
Select ... From StoreListing where is deleted = ...
If you have another column in the filter, it will never be used. So I don't think this will be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If [isDeleted, isApproved]
is indeed the filter column, the index with two columns will override the one below.
So we can safely remove it.
…wnership (#9179) This PR enables the execution of store agents even if they are not owned by the user. Key changes include handling store-listed agents in the `get_graph` logic, improving execution flow, and ensuring version-specific handling. These updates support more flexible agent execution. - **Graph Retrieval:** Updated `get_graph` to check store listings for agents not owned by the user. - **Version Handling:** Added `graph_version` to execution methods for consistent version-specific execution. - **Execution Flow:** Refactored `scheduler.py`, `rest_api.py`, and other modules for clearer logic and better maintainability. - **Testing:** Updated `test_manager.py` and other test cases to validate execution of store-listed agents added test for accessing graph --------- Co-authored-by: Reinier van der Leer <[email protected]> Co-authored-by: Zamil Majdy <[email protected]>
Description
This PR enables the execution of store agents even if they are not owned by the user. Key changes include handling store-listed agents in the
get_graph
logic, improving execution flow, and ensuring version-specific handling. These updates support more flexible agent execution.Changes 🏗️
get_graph
to check store listings for agents not owned by the user.graph_version
to execution methods for consistent version-specific execution.scheduler.py
,rest_api.py
, and other modules for clearer logic and better maintainability.test_manager.py
and other test cases to validate execution of store-listed agents added test for accessing graph