zeroclaw/web
Giulio V c47bbcc972
fix(cron): add startup catch-up and drop login shell flag (#3948)
* fix(cron): add startup catch-up and drop login shell flag

Problems:
1. When ZeroClaw started after downtime (late boot, daemon restart),
   overdue jobs were picked up via `due_jobs()` but limited by
   `max_tasks` per poll cycle — with many overdue jobs, catch-up
   could take many cycles.
2. Cron shell jobs used `sh -lc` (login shell), which loads the
   full user profile on every execution — slow and may cause
   unexpected side effects.

Fixes:
- Add `all_overdue_jobs()` store query without `max_tasks` limit
- Add `catch_up_overdue_jobs()` startup phase that runs ALL overdue
  jobs once before entering the normal polling loop
- Extract `build_cron_shell_command()` helper using `sh -c` (non-login)
- Add structured tracing for catch-up progress
- Add tests for all new functions

* feat(cron): make catch-up configurable via API and control panel

Add `catch_up_on_startup` boolean to `[cron]` config (default: true).
When enabled, the scheduler runs all overdue jobs at startup before
entering the normal polling loop. Users can toggle this from:

- The Cron page toggle switch in the control panel
- PATCH /api/cron/settings { "catch_up_on_startup": false }
- The `[cron]` section of the TOML config editor

Also adds GET /api/cron/settings endpoint to read cron subsystem
settings without parsing the full config.

* fix(config): add catch_up_on_startup to CronConfig test constructors

The CI Lint job failed because the `cron_config_serde_roundtrip` test
constructs CronConfig directly and was missing the new field.
2026-03-19 14:10:37 -04:00
..
src fix(cron): add startup catch-up and drop login shell flag (#3948) 2026-03-19 14:10:37 -04:00
.gitignore fix(web): ensure web/dist exists in fresh clones (#3114) 2026-03-16 18:37:14 -04:00
index.html feat(web): electric blue dashboard restyle with animations and logo (#3445) 2026-03-13 17:27:41 -04:00
package-lock.json fix(web): update rollup to patch path traversal vulnerability (#3258) 2026-03-11 23:24:04 -04:00
package.json feat(web): electric blue dashboard restyle with animations and logo (#3445) 2026-03-13 17:27:41 -04:00
tsconfig.app.json feat(gateway): add embedded web dashboard with React frontend 2026-02-21 16:14:01 +08:00
tsconfig.json feat(gateway): add embedded web dashboard with React frontend 2026-02-21 16:14:01 +08:00
tsconfig.node.json feat(gateway): add embedded web dashboard with React frontend 2026-02-21 16:14:01 +08:00
vite.config.ts feat(web): electric blue dashboard restyle with animations and logo (#3445) 2026-03-13 17:27:41 -04:00