Add scheduled prompt timers, per-session notification opt-in, and "still running" reminders#247
Add scheduled prompt timers, per-session notification opt-in, and "still running" reminders#247
Conversation
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
|
@copilot no, what i wanted here is a way to set timers thay will run a given prompt and them report back to me |
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Implemented in c21cd08. The feature works as follows: Scheduling a prompt — from any session's context menu (sidebar or card), tap "📅 Schedule a prompt…" to open a form where you enter:
How it works:
Managing schedules — the panel also lists existing schedules for the session with a countdown (e.g. "12m", "1h 5m") and an ✕ to remove them. Schedules persist across restarts in 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Root cause of wrong-remote pushes: - Workers used 'git fetch origin pull/<N>/head:pr-<N>' which creates a branch with NO tracking info. Subsequent 'git push' defaulted to origin, silently pushing to PureWeen/PolyPilot even for fork PRs. - Workers also used 'git rebase + --force-with-lease' which is unnecessary when using merge. Fix: - .squad/routing.md: updated Fix Process to use 'gh pr checkout <N>' (sets correct tracking) and 'git merge origin/main' (no force push needed) - .squad/decisions.md: explicit rules against force push and manual fetch - push-to-pr.sh: script that derives correct remote from gh pr view metadata and pushes without --force, with pre-push safety checks Verified: 'gh pr checkout' correctly sets tracking to fork remote for PR #280 (vitek-karas) and to origin for same-repo PRs like #247 (PureWeen). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Problem PR review workers were pushing to the wrong remote (e.g., pushing to `origin/PureWeen` when the PR comes from a fork like `vitek-karas`), and using `--force-with-lease` after rebasing unnecessarily. ### Root Cause (verified by testing) Workers were using manual checkout: ```bash git fetch origin pull/<N>/head:pr-<N> git checkout pr-<N> ``` This creates a branch with **no tracking info** (`Remote: NONE`, `Merge: NONE`). When the worker then runs `git push` or `git push origin`, git defaults to `origin` (PureWeen/PolyPilot) — even if the PR came from a fork. In contrast, `gh pr checkout <N>` correctly sets up tracking: - Same-repo PR #247: `Remote: origin`, `Merge: refs/heads/copilot/build-notification-and-timers` ✅ - Fork PR #280: `Remote: vitek-karas`, `Merge: refs/heads/Add-a-way-to-specify-polypilot-clone-root-7299` ✅ The second problem was `git rebase origin/main` + `--force-with-lease`, which requires force pushing. Using `git merge origin/main` adds a merge commit instead — no force push needed. ## Changes ### `push-to-pr.sh` A shell script that: 1. Reads PR metadata via `gh pr view` to find the correct owner and branch 2. Maps the owner to the correct git remote 3. Pushes to that remote **without** `--force` 4. Verifies the push landed by comparing local and remote HEADs 5. Refuses to push if current branch doesn't match the PR branch (guards against wrong-branch pushes) ### `.squad/routing.md` Updated Fix Process replacing rebase+force-push with merge+safe-push, with clear explanation of why `gh pr checkout` is required. ### `.squad/decisions.md` Explicit shared rules: - Never force push - Always use `gh pr checkout` (not manual fetch) - Always merge (not rebase) - Always verify push target before pushing - Use `push-to-pr.sh` for all PR pushes ### `.squad/team.md` Team definition file (required for squad directory to be recognized by PolyPilot's squad discovery). --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR #247 Review — Scheduled Prompt Timers & NotificationsCI: Consensus Findings (2+ of 5 models)
Detail🔴 1 — Save-before-send: one-shot prompts silently lostIn // State advanced and persisted here...
sp.NextRunAt = null;
sp.IsEnabled = false;
Save(); // ← prompt now permanently disabled on disk
NotifyChanged();
// ...then send attempted here
var result = await _copilot.SendPromptAsync(sp.SessionName, sp.Prompt);If Fix: Move the advance/disable logic to after 🔴 2 — TOCTOU:
|
Adds three notification and timer features to Copilot sessions.
Scheduled prompt timers
The core feature: set a timer that automatically runs a given prompt in a session and reports back with the results via system notification.
ScheduledPromptmodel — stores session name, prompt text, optional label,NextRunAt,RepeatIntervalMinutes,IsEnabled,LastRunAtScheduledPromptService— background timer checks every minute for due prompts, fires them viaSendPromptAsync(enqueues if session is busy, retries if session is not found), sends a system notification when the result arrives. Persists schedules to~/.polypilot/scheduled-prompts.jsonPer-session notification opt-in
AgentSessionInfo.NotifyOnComplete(bool, defaultfalse) — per-session flag independent of the globalEnableSessionNotificationssettingCopilotService.SetSessionNotifyOnComplete(sessionName, bool)— public toggle methodTimer-based "still running" reminders
ConnectionSettings.NotificationReminderIntervalMinutes(int, default0= off) — configures reminder cadenceSendReminderNotificationIfDueAsynceach tick with interval-based deduplication viaInterlocked.CompareExchange"⏱ Still running · 5m elapsed"/"⏱ Still running · 1h 10m elapsed"💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.