Skip to content

feat(tasks): duplicate/clone an existing cron job #528

@nesquena-hermes

Description

@nesquena-hermes

Summary

There is no way to duplicate an existing cron job in the Tasks panel. If you want to create a similar job with a different schedule, delivery target, or slight prompt variation, you have to create it from scratch via the form.

Current behaviour

Each cron job card has: Run Now, Pause/Resume, Edit, Delete. No duplicate/clone option.

Proposed behaviour

A "Duplicate" option in the cron job action menu (or a clone icon button) that pre-populates the new cron form with all fields copied from the existing job. The name gets a " (copy)" suffix so users know to rename it before saving. The duplicated job is created in paused state by default to avoid accidentally running two identical jobs immediately.

Implementation notes

  • Frontend: add duplicate button to cron card actions in static/panels.js. On click, populate the cron form fields (name, schedule, prompt, skills, deliver) with values from the source job and open the form.
  • Backend: no new endpoint needed — the existing /api/crons POST creates a new job. The frontend just pre-fills the form.
  • The duplicated job should get a new job_id (handled automatically by the scheduler on create).
  • Default state: paused (pass paused: true on creation, or pause immediately after creation).

Files involved

  • static/panels.js — duplicate button, form pre-fill logic
  • static/style.css — button styling (minor)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttasksCron jobs, task scheduling, background jobs

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions