-
Notifications
You must be signed in to change notification settings - Fork 44.7k
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(platform) : scheduling agent runner #8634
feat(platform) : scheduling agent runner #8634
Conversation
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
✅ Deploy Preview for auto-gpt-docs canceled.
|
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
Amazing contribution @Abhi1992002, well done! |
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.
Thank you for the contributions! I've added a couple of comments related to the API, let me know your thoughts!
|
||
const api = useMemo(() => new AutoGPTServerAPI(), []); | ||
|
||
const fetchSchedules = useCallback(async () => { | ||
const schedulesData: Schedule[] = []; | ||
for (const flow of flows) { |
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.
I see that you did this due to non-optimized backend, I've improved the API here so you can do GET /schedules and get all the schedules for a user without firing multiple requests and add more information on the GET response:
#8649
I'm happy with any of the ordering, we can first get this merged and improve it and update the routing on my PR, or you can rebase your PR based on the above PR.
@@ -0,0 +1,239 @@ | |||
export class CronExpressionManager { |
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.
Would this be any simpler if we utilize https://www.npmjs.com/package/cron ?
} from "@/components/ui/dialog"; | ||
import { Separator } from "./ui/separator"; | ||
import { CronExpressionManager } from "@/lib/monitor/cronExpressionManager"; | ||
// import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; |
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.
nit: Remove this?
<Separator /> | ||
{/* | ||
|
||
On the backend, we are using standard cron expressions, |
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.
This is a really good idea, I can accommodate this on my API #8649, what field do you think you need for this? I can add end_time on the GET
PUT
& POST
request wdyt?
title: "Agent scheduling successful", | ||
}); | ||
|
||
// if schduling is done from the monitor page, then redirect to monitor page after successful scheduling |
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.
nit: typo
return this._request("PUT", `/graphs/schedules/${scheduleId}`, update); | ||
} | ||
|
||
async getSchedules(graphId: string): Promise<{ [key: string]: string }> { |
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.
After seeing it used by the client, I think it makes much more sense to make the API route simply /schedules
without the graph intervention, I can add graph_id
as a query parameter for GET request as an optional filtering clause.
@@ -329,3 +329,19 @@ export type AnalyticsDetails = { | |||
data: { [key: string]: any }; | |||
index: string; | |||
}; | |||
|
|||
// Schedule types |
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.
nit: the comment, except the cron expression, might not be necessary
Just tested it, this is a fantastic contribution @Abhi1992002 Thank you! |
Feature #8461
Created a table on the monitor page to display all schedules.
This table includes options to filter schedules based on graphs and to create a new schedule.
Each graph page now has a button to create a schedule.
Changes 🏗️
Removed
isEnabled
fromautogpt_platform/backend/backend/data/schedule.py
because it was not fetching the disabled schedules, which prevented them from ending as cron jobs.Added a schedule table on the monitor page to display all schedules:
Used
cronExpressionManager.ts
to create cron expressions and descriptions for each cron expression.Created types and requests for schedule endpoints.
Reused the run button component to enable rescheduling of graphs.
Some Screenshots
Video
Untitled.video.-.Made.with.Clipchamp.mp4