Skip to content

feat(ui): add scheduled task management#354

Open
jromualdez-scale wants to merge 18 commits into
mainfrom
jerome/scheduled-tasks-ui
Open

feat(ui): add scheduled task management#354
jromualdez-scale wants to merge 18 commits into
mainfrom
jerome/scheduled-tasks-ui

Conversation

@jromualdez-scale

@jromualdez-scale jromualdez-scale commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Scheduled Tasks experience with direct creation, a consolidated cadence editor, active/paused controls, edit flows, irreversible-delete confirmation, and a disabled “Snooze — coming soon” affordance.
  • Add an occurrence-focused Upcoming timeline with current/all-agent scope, synchronized task-sidebar filtering, balanced previews for frequent schedules, run-now flows, and exact skip/unskip actions.
  • Use the generated TypeScript schedule SDK, label scheduled runs consistently in the task sidebar, and keep scheduled task titles stable without appending occurrence timestamps.

UX details

  • Create schedules immediately without a confirmation step; show animated pending/success feedback with Edit and auto-dismiss.
  • Group upcoming runs into Today, Tomorrow, and Later; show 10 by default with at most 3 per schedule, then allow expansion to the 10 occurrences returned per schedule.
  • Keep occurrence actions scoped to Skip/Unskip and Edit schedule; keep Pause/Resume, Delete, Run now, and Skip next run in the Schedules view.
  • Keep schedule names consistent with agent naming semantics: auto-generated kebab-case names are displayed and copied to scheduled task metadata.

Test plan

  • npm --prefix agentex-ui run typecheck
  • npm --prefix agentex-ui run lint
  • npm --prefix agentex-ui run test:run -- hooks/use-safe-search-params.test.tsx lib/agent-run-schedules.test.ts lib/schedule-utils.test.ts
  • Local smoke test with two registered agents, cross-agent schedule scope, upcoming schedule details, and schedule actions
  • Pre-commit Agentex UI lint hooks
Screen.Recording.2026-07-13.at.2.25.20.PM.mov

Greptile Summary

This PR delivers a full Scheduled Tasks UI surface: inline schedule creation with animated feedback, an Upcoming timeline grouped by Today/Tomorrow/Later, a Schedules list with pause/resume toggle, skip/unskip per-occurrence, run-now flows, edit and delete modals, and a feature flag (ENABLE_AGENT_RUN_SCHEDULES) that gates the entire experience.

  • New agentex-ui/components/scheduled-tasks/ module (~1 400 lines) provides the page, composer, cadence picker, upcoming list, schedules list, modals, and shared helpers; routing is handled entirely via URL search params (view, schedule_scope, agent_name).
  • lib/schedule-utils.ts owns cadence serialization, validation, display, and the scheduleToCadence round-trip used by the edit form.
  • agentex/src/temporal/activities/scheduled_agent_run_activities.py removes _format_fire_time and the per-occurrence timestamp from task_metadata.display_name, keeping task names stable across retries.

Confidence Score: 5/5

Safe to merge; the feature is flag-gated and all CRUD flows, cache invalidation, and error paths look correct.

Additive, flag-gated change. TanStack Query cache keys are well-structured, mutation error handling surfaces toasts via onError, and search-param routing clears stale VIEW values on task selection. The two findings only affect externally-created sub-minute or complex-cron schedules that the UI itself never produces.

agentex-ui/lib/schedule-utils.ts — specifically scheduleToCadence (sub-minute round-trip) and describeCadence (missing complex-cron fallback).

Important Files Changed

Filename Overview
agentex-ui/lib/schedule-utils.ts New utility module for cadence serialization, validation, and display. scheduleToCadence silently coerces sub-minute interval_seconds (e.g. 30 s → 1 min) and describeCadence lacks the raw-expression fallback its inline comment promises for complex external crons.
agentex-ui/hooks/use-agent-run-schedules.ts New TanStack Query hooks for schedule CRUD and actions. Cache key structure is consistent, invalidation logic is correct, and error toasts are surfaced via onError. Limit is 50 and is surfaced in the UI.
agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx Main page orchestrating scope/agent/view state. Correctly wires search-param-driven scope selection and shows ScheduleComposer only for the current-agent scope.
agentex-ui/components/scheduled-tasks/all-schedules-list.tsx Schedule list with inline pause/resume toggle and overflow menu. Functionally correct; idempotent API calls handle the case where row-level and menu-level mutation pending states don't reflect each other.
agentex-ui/components/scheduled-tasks/upcoming-schedule-list.tsx Upcoming runs timeline with Today/Tomorrow/Later grouping. Run-now/skip sequential flow is handled correctly with .catch(() => undefined) to suppress uncaught-rejection noise while onError toasts surface failures.
agentex-ui/components/scheduled-tasks/schedule-modals.tsx Delete confirmation and edit modals. Name normalization/sanitization on blur, cadence round-trip via scheduleToCadence, and inline delete from the edit modal all look correct.
agentex/src/temporal/activities/scheduled_agent_run_activities.py Removes per-occurrence timestamp from display_name (now just schedule.name), removes the unused _format_fire_time helper, and keeps _extract_fire_time/regex for UI occurrence-time parsing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Page Load] --> B{agentRunSchedulesEnabled?}
    B -->|false| C[Chat / Home only]
    B -->|true| D{view=scheduled_tasks?}
    D -->|no| E{taskID param?}
    E -->|yes| F[ChatView]
    E -->|no| G[HomeView]
    D -->|yes| H[ScheduledTasksPage]
    H --> I{scheduleScope?}
    I -->|ALL| J[useAgentRunSchedulesForAgents all agents]
    I -->|CURRENT| K{agent selected?}
    K -->|no| L[Empty State: Select an agent]
    K -->|yes| M[useAgentRunSchedules current agent]
    J --> N[useAgentRunScheduleDetailsForItems one req per schedule]
    M --> N
    N --> O{scheduleView?}
    O -->|upcoming| P[UpcomingScheduleList Today/Tomorrow/Later]
    O -->|all| Q[AllSchedulesList sorted by next run]
    M --> R[ScheduleComposer create new schedule]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Page Load] --> B{agentRunSchedulesEnabled?}
    B -->|false| C[Chat / Home only]
    B -->|true| D{view=scheduled_tasks?}
    D -->|no| E{taskID param?}
    E -->|yes| F[ChatView]
    E -->|no| G[HomeView]
    D -->|yes| H[ScheduledTasksPage]
    H --> I{scheduleScope?}
    I -->|ALL| J[useAgentRunSchedulesForAgents all agents]
    I -->|CURRENT| K{agent selected?}
    K -->|no| L[Empty State: Select an agent]
    K -->|yes| M[useAgentRunSchedules current agent]
    J --> N[useAgentRunScheduleDetailsForItems one req per schedule]
    M --> N
    N --> O{scheduleView?}
    O -->|upcoming| P[UpcomingScheduleList Today/Tomorrow/Later]
    O -->|all| Q[AllSchedulesList sorted by next run]
    M --> R[ScheduleComposer create new schedule]
Loading

Reviews (8): Last reviewed commit: "Merge branch 'main' into jerome/schedule..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

✱ Stainless preview builds

This PR will update the agentex-sdk SDKs with the following commit messages.

openapi

feat(api): add skip/unskip/by-name methods, response fields to schedules

python

feat: Add scheduled tasks UI polish

typescript

feat(api): add num_tasks_created and skipped_action_times fields to schedules

Edit this comment to update them. They will appear in their respective SDK's changelogs.

agentex-sdk-openapi studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ❗

New diagnostics (2 note)
💡 Endpoint/NotConfigured: Skipped endpoint because it's not in your Stainless config: `post /agents/{agent_id}/schedules/{schedule_id}/skip`
💡 Endpoint/NotConfigured: Skipped endpoint because it's not in your Stainless config: `post /agents/{agent_id}/schedules/{schedule_id}/unskip`
agentex-sdk-typescript studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ❗build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/agentex-sdk-typescript/8cb79bd084af03a986befc8095d4a943d2c5301f/dist.tar.gz
New diagnostics (2 note)
💡 Endpoint/NotConfigured: Skipped endpoint because it's not in your Stainless config: `post /agents/{agent_id}/schedules/{schedule_id}/skip`
💡 Endpoint/NotConfigured: Skipped endpoint because it's not in your Stainless config: `post /agents/{agent_id}/schedules/{schedule_id}/unskip`
agentex-sdk-python studio · conflict

Your SDK build had at least one new note diagnostic, which is a regression from the base state.

New diagnostics (2 note)
💡 Endpoint/NotConfigured: Skipped endpoint because it's not in your Stainless config: `post /agents/{agent_id}/schedules/{schedule_id}/skip`
💡 Endpoint/NotConfigured: Skipped endpoint because it's not in your Stainless config: `post /agents/{agent_id}/schedules/{schedule_id}/unskip`

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-07-09 17:13:15 UTC

@jromualdez-scale
jromualdez-scale force-pushed the jerome/scheduled-tasks-ui branch 2 times, most recently from 8445f04 to 0673c3d Compare July 9, 2026 17:05
jromualdez-scale and others added 6 commits July 10, 2026 13:00
Co-authored-by: Cursor <cursoragent@cursor.com>
Expose task-backed run counts and exact skip/unskip operations so schedule clients can reason about individual future occurrences.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add agent scoping, upcoming occurrence timelines, active toggles, run-now confirmation, and skipped occurrence controls to the scheduled tasks page.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use schedule metadata for scheduled-run task labels and add a calendar indicator so recurring runs are easier to recognize.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use the schedule name as the task display label and keep occurrence timing in metadata for views that need it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale
jromualdez-scale force-pushed the jerome/scheduled-tasks-ui branch from 0673c3d to e36d4cd Compare July 10, 2026 17:40
Co-authored-by: Cursor <cursoragent@cursor.com>
@socket-security

socket-security Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​agentex@​0.1.0-alpha.9 ⏵ 0.1.0-alpha.2078 -110099 +196 +5100

View full report

@jromualdez-scale jromualdez-scale changed the title Add scheduled tasks UI polish feat(ui): add scheduled task management Jul 13, 2026
@jromualdez-scale
jromualdez-scale marked this pull request as ready for review July 13, 2026 15:37
@jromualdez-scale
jromualdez-scale requested a review from a team as a code owner July 13, 2026 15:37
@jromualdez-scale
jromualdez-scale marked this pull request as draft July 13, 2026 15:38
Comment thread agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx Outdated
Comment thread agentex-ui/hooks/use-agent-run-schedules.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale
jromualdez-scale marked this pull request as ready for review July 13, 2026 17:29
@jromualdez-scale
jromualdez-scale marked this pull request as draft July 13, 2026 17:31
jromualdez-scale and others added 2 commits July 13, 2026 14:09
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale
jromualdez-scale marked this pull request as ready for review July 13, 2026 18:23
Hide the scheduled tasks UI unless the schedules API is enabled so users do not navigate to endpoints that are absent at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread agentex-ui/components/task-sidebar/task-sidebar-header.tsx Outdated
Comment thread agentex-ui/hooks/use-agent-run-schedules.ts
Comment thread agentex-ui/lib/schedule-utils.ts
Comment thread agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx Outdated
Comment thread agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx Outdated
Comment thread agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx

@declan-scale declan-scale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ran locally, looks good, just some organization / small ui improvements I'd suggest

jromualdez-scale and others added 2 commits July 14, 2026 21:59
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale

Copy link
Copy Markdown
Contributor Author

Ran locally, looks good, just some organization / small ui improvements I'd suggest

Thanks for the great comments @declan-scale I addressed them all

Comment thread agentex-ui/app/page.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants