feat(cronjob): add ScheduledRun for cron-based agent execution#1850
Draft
0xLeo258 wants to merge 1 commit into
Draft
feat(cronjob): add ScheduledRun for cron-based agent execution#18500xLeo258 wants to merge 1 commit into
0xLeo258 wants to merge 1 commit into
Conversation
7502b9e to
bdcd3cb
Compare
f414523 to
407a3ca
Compare
Adds ScheduledRun (kagent.dev/v1alpha2) to fire an existing agent on a cron schedule with a static prompt. Scope is limited to scheduling — does not extend the agent definition. Two-stage status semantics: DispatchStatus is written synchronously (did the A2A SendMessage land at the agent pod), Outcome is resolved asynchronously by polling the session's terminal task state. This lets RunHistory reflect whether the agent actually completed the work, not just whether the dispatch HTTP call returned 200 — agents have built-in retries, so dispatch success and run success are different signals. Lands without controller-side concurrency gating: the agent pod already serializes A2A calls per session, so overlapping ticks queue at the agent layer rather than needing an inFlight map / mutex in the controller. Includes CRD + controller, scheduler with outcome poller, REST API (CRUD + manual trigger), Prometheus metrics, and UI (list, detail with run history, create form). Manual trigger bypasses spec.suspend by design. Co-authored-by: 0xLeo258 <0xLeo258@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
407a3ca to
1e3c6a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a new ScheduledRun CRD that allows users to schedule recurring agent invocations using cron expressions. The controller manages scheduling, concurrency policies, and run history tracking.
Key changes:
Closes #1821