Skip to content

Add scheduled tasks for recurring prompt execution#380

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-cron-job-for-clause-tasks
Draft

Add scheduled tasks for recurring prompt execution#380
Copilot wants to merge 4 commits intomainfrom
copilot/add-cron-job-for-clause-tasks

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

Adds a cron-like scheduled tasks system for recurring prompt execution — daily stand-ups, periodic reviews, automated checks, etc.

Model (ScheduledTask.cs)

  • Three schedule types: Interval (every N minutes), Daily (at time), Weekly (days + time)
  • Schedule calculation via GetNextRunTimeUtc / IsDue with proper UTC↔local handling
  • Run history (last 10 entries) with success/error tracking

Service (ScheduledTaskService.cs)

  • Background timer evaluates due tasks every 30s with interlocked overlap guard
  • Executes by sending prompt to existing session or creating a new one per run
  • Persists to ~/.polypilot/scheduled-tasks.json
  • Auto-starts on singleton creation via DI

UI (ScheduledTasks.razor)

  • Full CRUD page at /scheduled-tasks with form validation
  • Task cards: toggle, edit, run-now, delete, last/next run display
  • Clock icon added to sidebar nav between Tutorial and Info

Tests (32 tests)

  • Model serialization, schedule descriptions, time parsing, due detection
  • Service persistence round-trip, CRUD, execution against demo mode, corrupt file handling
  • Test isolation via SetTasksFilePathForTesting wired into TestSetup.cs
var task = new ScheduledTask
{
    Name = "Daily Stand-up",
    Prompt = "Summarize yesterday's changes and open PRs",
    Schedule = ScheduleType.Daily,
    TimeOfDay = "09:00",
    DaysOfWeek = new() { 1, 2, 3, 4, 5 }
};
taskService.AddTask(task);
// Timer fires every 30s → IsDue() → SendPromptAsync()

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 192.0.2.1
    • Triggering command: `/usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.deps.json /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/testhost.dll --port 46385 --endpoint 127.0.0.1:046385 --role client --parentprocessid 5138 --telemetryoptedin false ice with REDACTED timer evaluation and persistence
  • ScheduledTasks.razor page with create/ed` (packet block)
  • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.deps.json /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/testhost.dll --port 45055 --endpoint 127.0.0.1:045055 --role client --parentprocessid 6539 --telemetryoptedin false (packet block)
  • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.deps.json /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/testhost.dll --port 42843 --endpoint 127.0.0.1:042843 --role client --parentprocessid 7868 --telemetryoptedin false (packet block)
  • 4myvsblobprodcus32.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/55BB33C8E1046D06DB6BC8FB401555C0/missingpackages_workingdir --packages /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • 4vyvsblobprodcus361.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/55BB33C8E1046D06DB6BC8FB401555C0/missingpackages_workingdir --packages /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • frdvsblobprodcus327.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/55BB33C8E1046D06DB6BC8FB401555C0/missingpackages_workingdir --packages /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • se1vsblobprodcus349.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/55BB33C8E1046D06DB6BC8FB401555C0/missingpackages_workingdir --packages /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • ukkvsblobprodcus352.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/55BB33C8E1046D06DB6BC8FB401555C0/missingpackages_workingdir --packages /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[request] Cron job (repetitive tasks execution), to replicate the new claude code scheduled tasks</issue_title>
<issue_description>[request] Cron job (repetitive tasks execution), to replicate the new claude code scheduled tasks
ideal for daily stand-ups and repetitive executions.

similar tool which leverage this
runclauderun
Image

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits March 15, 2026 23:54
…gation

- ScheduledTask model with Interval/Daily/Weekly schedule types
- ScheduledTaskService with background timer evaluation and persistence
- ScheduledTasks.razor page with create/edit/delete/toggle/run-now UI
- 32 unit tests covering model, serialization, schedule logic, and service
- Navigation link in sidebar and DI registration

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
…tests

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
… guard, improve timestamp format, optimize nextRun calculation

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot AI changed the title [WIP] [request] Add cron job for replicating new claude code tasks Add scheduled tasks for recurring prompt execution Mar 16, 2026
Copilot AI requested a review from PureWeen March 16, 2026 00:14
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.

[request] Cron job (repetitive tasks execution), to replicate the new claude code scheduled tasks

2 participants