Cron self-healing
How Omniscio reacts when a scheduled job fails for good: it pauses the job and hands the failure to a fresh Claude session pre-loaded with the error and logs, so the agent can fix the cause, verify it, and resume the schedule — plus the three-strike cap that stops it looping.
On this page
What it is
Omniscio's cron scheduler runs scripts and recipes on a fixed schedule. When one of those jobs fails for the last time (after every retry has been exhausted), Omniscio hands the failure to a fresh Claude session that has been pre-loaded with the failing job's command, schedule, exit code (or "none" when the run ended without reporting one, so a launch the app lost never reads as a successful exit 0), the last 50 lines of stderr and stdout, and a list of regex hits like ENOENT or ECONNREFUSED. The heal session's job is to figure out what broke, edit the project files to fix it, verify the fix, and resume the schedule. Verification is side-effect-aware: the on-demand /run is a real production execution (real environment, real side effects — not a dry run), so the heal prompt tells the agent to re-run only jobs that are safe to repeat (idempotent, no external side effects) and to verify a side-effect-bearing job — one that sends email, fires a webhook, calls an API, moves money, or pushes a commit — without re-executing it, so an auto-fired heal can't repeat those irreversible effects. The cron stays paused the whole time, so a broken job cannot keep firing alongside the agent that's trying to fix it.
The feature is on by default for every job (since 2026-08-21 — new jobs default on via createCronJob, and every existing job was backfilled on by migration 20260821175646). A job opts OUT by turning Self-Healing off (healingEnabled: false); session-type jobs never heal regardless (Guard 0). There is one toggle: Self-Healing on means heal sessions auto-fire on every final failure of this job — no inbox approval, no category gate, no second toggle to set. The reasoning is the user's words from 2026-05-11: "self-healing that requires approval is not self-healing". Heal sessions can edit code in the project but cannot rewrite the cron's own definition or touch other jobs, and after three consecutive failed heals Omniscio stops trying and posts an escalation card so you notice.
2026-05-11 redesign. Earlier versions of this feature shipped a nested Auto-fire toggle and an inbox approval card so the user could review each heal before it spawned. The Approve button was broken (the dispatcher arm threw on the legacy payload shape it had stopped emitting) and — independent of the bug — the design itself missed: an approval-gated heal that won't run until a human clicks is not self-healing. The toggle, the pane's Approve/Reject buttons, the bug, and the entire approval-gated code path were removed in one change. The DB column
cron_jobs.healing_auto_fireis preserved for backward compatibility but is no longer read or written — Guard 1 readshealing_enabledonly. Pre-redesignpendingheal rows incli_pending_actionsare auto-fired by theautoFireExistingPendingHealsstartup migration so users don't lose any in-flight work.
Where to find it
The switch lives on the job itself. In Omniscio's Cron Jobs virtual project, open the job you care about to bring up its editor dialog, and Self-Healing sits below Require Approval in that same form. Everything after that happens without you: the heal session shows up as an ordinary session in the project the job belongs to, and the job's row in the Cron Jobs view turns paused while it works.
How it behaves
Interaction with cron failure alerts
Cron failure alerts (cron-failure-alerts.md) are the other half of the same story: when a cron job fails for the last time, Omniscio always considers BOTH (a) inserting a cron.failure_alert row in the inbox so you see "this job broke" and (b) creating a cron.failure_heal attempt so an agent can fix it. They are two views of the same failure — the alert tells you, the heal fixes it — and they coordinate so you don't see both for the same incident.
- An open heal suppresses the alert card. When a
cron.failure_healheal-attempt row exists inpendingorspawnedfor the same job, the failure-alert producer's skip conditions short-circuit and no alert card is inserted. The reasoning: if Omniscio has already escalated to "an agent is going to fix this", surfacing a separate "this is broken" card is duplicate noise. The OS toast still fires (the toast is the user's "something happened" cue, regardless of who's handling it) but the inbox stays clean. (After the 2026-05-11 redesign, every new heal attempt goes straight frompendingtospawnedin the same atomic transaction — there is no human-gatedpendingwindow — so the practical effect of this rule is "spawned heal suppresses alert".) - Once the heal closes, alerts are eligible again. When the heal ends — fixed, abandoned, or escalated — the suppression lifts. If the job fails again on a future run, the alert card is allowed to insert.
- Bridge from alert to fixing. The alert card offers two routes. (a) Fix with AI — opens a Start-session dialog to fix the job by hand right now (a normal Claude session pre-filled with the error; it pauses the job while you work), NOT the
healNowmanual-heal path. (b) An inline Auto-fix toggle flipshealingEnabledin place with a success toast, so future failures go through the auto heal pipeline (this is the route that actually engages self-healing). (View job navigates to the Cron Jobs editor; both routes above stay in the inbox.)
How to use it
- Open the job's editor. In Omniscio's Cron Jobs virtual project, click any job to bring up its editor dialog. Self-healing lives below "Require Approval" in the same form.
- Leave Self-Healing on (or flip it off to opt out). The toggle is labelled Self-Healing with the description "Detect failures and auto-launch a heal session to fix them." On by default — every new job self-heals and all existing jobs were backfilled on; turn it off for a specific job you don't want auto-fixed. There is no second toggle: Self-Healing on means the heal session auto-fires on every final failure.
- Save and let it run. When the job next fails for good (i.e. after every retry has been exhausted), Omniscio pauses the cron and spawns the heal session into the project the cron belongs to. The cron's row in the Cron Jobs view will switch to paused. There is no approval card and nothing to click — the heal is already running.
A run whose script provably never started is NOT a final failure and never opens a heal: it is re-run once automatically after a short delay instead. Three cases count: the hidden-console wrapper never created either output file; the app's launcher failed before any process existed at all (the run's error arrives with no process id — measured 2026-11-07, when every in-flight launch failed
connect EBADFon its own output pipe while the app's main thread was frozen); or the launcher was restarted while the launch was waiting and gave it up as "outcome unknown" (spawn worker unavailable: no answer to a posted launch for 60000ms— measured 2026-11-07 18:19, when one stalledgit.exelaunch held the launcher for 81 s). In that third case the app first deletes the job's temporary script and only then checks that neither output file exists, so a late start can never run the job a second time; a job run with a visible window has nothing on disk to prove that with and stays a normal failure. Only if that one re-run also fails does the normal failure path above apply. - Watch for the resume. The heal session has been told the cron is paused and needs to call a
/toggleendpoint to resume the schedule once the fix verifies green. When that happens Omniscio marks the heal "fixed" and the job goes back to normal scheduled runs. A fix you asked for by hand (Fix it) resets the consecutive-failure counter to zero at once; an automatic fix counts as a provisional strike until the job has sustained its recovery (3 green runs and 6 clean hours), so a heal that only got a lucky pass cannot keep re-arming a flaky job. - Look for the escalation card after three strikes. If three consecutive heals count as strikes — a heal abandons (the agent gave up, the session was archived without resuming the cron, the app was restarted mid-heal, etc.), or an automatic heal ends "fixed" before the job has sustained its recovery — the gate stops creating new heal attempts and Omniscio posts a single inbox card —
<job name> needs human attention,3 failed self-heals— so you take over manually. Approving the escalation card is acknowledge-only — it dismisses the card without spawning a heal session, because the cap means the agent has already proven it can't fix this one without you. The card is not permanent, though: once the job has genuinely recovered on its own — at least 3 green runs AND 6 hours with no real failure — Omniscio resets the consecutive-failure counter to zero (re-arming self-healing) and auto-dismisses the escalation card. One lucky green run between failures is not enough: a job that fails on and off stays capped, so it cannot keep buying fresh rounds of heal sessions (clearHealEscalationOnSuccess; see § "Recovery on a successful run"). So a job whose underlying problem cleared up — a transient outage, or a heal that was only interrupted by an app restart — stops nagging you once it has run clean for a while (up to 6 hours for a frequent job, 3 runs for a daily one), instead of leaving behind a stale "needs attention" card while every run goes green.
The cron-job editor dialog UI lives in src/renderer/src/features/cron/JobEditorDialog.tsx. After the 2026-05-11 redesign there is a single Self-Healing toggle row — the previously-nested Auto-fire toggle row was removed.
A finished fix session takes itself off the board
Once a fix session has repaired the job and the schedule is running again, it does not need to sit in the inbox waiting for someone to archive it. By default it leaves on its own:
- The session is asked to sign off. Its prompt ends with a
When you are donesection: fixed and scheduled again means finishing the turn with[[OMNISCIO_SELF_ARCHIVE]]alone on the last line; anything still needing a person (an unverified fix, a cron left paused, something to confirm) means no marker, and the session stays in the inbox. - The app does not rely on that alone. Omniscio notes the moment a heal session is started, and the moment its heal is recorded as fixed. When that session's turn then ends cleanly, the app checks the heal record itself: if the heal is
fixedand the job is active again, the session is archived through the same self-archive decision every other sign-off uses — so an open question, work in flight or unread mail still keeps it on the board. The note is used up by that archive, so a session you reopen later to chat is never archived again. Both notes live with the running app, so a heal session that outlives an app restart falls back to the prompt (and the restart has already reconciled its heal). - A heal that is still live is refused an archive. While the heal is
spawned, an archive — by marker or by the HTTP route — is refused: archiving then would abandon the heal, count a strike and switch the job back on. Once the heal is fixed, or once it has already been abandoned, archiving is allowed again (an abandoned heal has nothing left to protect and the job is already back on). - Switch: Settings → Sessions → Cron fix sessions archive when finished (
cronHealSelfArchiveEnabled), on by default. Off means every finished fix session waits in the inbox for review. A heal session's prompt is fixed when it starts, so turning the switch off does not take back an instruction already given — and the app-side archive follows the switch as it stands at the end of each turn. It is also skipped for a job other synced computers run (that heal can never reachfixed), and when a self-archive would queue an approval instead of applying.
Related
The other half of the same story — the toast and inbox card that tell you a job broke, which a running heal deliberately suppresses — is on the cron failure alerts page. How cron jobs are created and where their editor lives is on the create a cron job with AI page, the approval queue these cards share is on the CLI pending actions page, and finding the logs is on the logs and debugging page.
- cron-failure-alerts.md — the toast + inbox-card surface that fires when a cron fails and there is no open heal in flight. Suppressed by an open heal. Its Fix with AI button opens a Start-session dialog to fix the job by hand (a normal session pre-filled with the error, not this manual-heal path); its inline Auto-fix toggle flips self-healing on/off in place for the job.
- create-cron-job-with-ai.md — how cron jobs are created, where the editor lives, what the cron tick does in normal operation.
- cli-pending-actions.md — the inbox approval queue heal cards share with cron / automation / project-delete approvals.
- logs-and-debugging.md — finding
main.logand the in-app Debug Log Viewer.
Last verified 2026-09-23