Skip to content

feat(schedules): one Schedules page for every routine, automation schedule and the backup - #535

Merged
adeelahmad merged 11 commits into
mainfrom
claude/project-thread-hf7zaq
Oct 18, 2026
Merged

adeelahmad merged 11 commits into
mainfrom
claude/project-thread-hf7zaq

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: anything that ran on a clock lived on its own page. Routines had their schedule on the Routines page (admins only), an automation's schedule and at triggers were only readable over the API, MCP and chat, and the backup's schedule was in Settings › Backups. There was no one place to see what Lens would do next, or when something last ran.

After: a Schedules page (Automate › Schedules) is Lens's crontab. One list, soonest first, with every routine, every automation schedule or at trigger (one row per trigger) and the backup, each saying when it runs in words and as cron with its time zone, when it runs next, how and when it last ran, and whether it's on. From the row: a switch, "Change when it runs" (presets or a cron of your own, any time zone, the next five times shown before saving, Enter saves; an at trigger takes a new date and time) and Run now (a routine over budget asks first). Someone who isn't an admin sees the schedules of the automations they manage.

Agents get the same list and the same changes: GET /api/v1/schedules, GET /api/v1/schedules/{id}, PATCH /api/v1/schedules/{id} (cron, at, timezone, enabled), POST /api/v1/schedules/{id}/run, and the MCP tools schedules, set_schedule and run_schedule.

Motivation and Context

Adeel asked for a "crontab manager": a single view to see and manage every scheduled workflow and routine.

Nothing new is stored: the list is read from the routines, the automations' timers and the backup setting each time, and every change goes through the routine's, the automation's or the setting's own route, so their checks (schedule that never runs, unknown zone, who may change it) and audit log are reused.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. (n/a: the title says it; the changelog is generated from titles.)

Done questions (AGENTS.md)

  • Goal: one page for every scheduled routine, automation trigger and the backup, with view, on/off, re-time, run now, next and last run. Local CI (ci/local-ci.sh) passed all six jobs; merged on green.
  • Agents: /api/v1/schedules and the MCP tools schedules, set_schedule, run_schedule (test_agents_list_change_and_run_schedules_over_mcp).
  • Zero setup: nothing to install or configure; the page reads what's already there.
  • Fewest clicks: switch, change and run from the row; presets with the current one preselected; Enter saves; the backup switch opens its schedule editor instead of failing.
  • Configurable: n/a, no new settings. The backup schedule it edits is the existing Settings › Backups one.
  • Light: a read-through list, no new process, no new dependency.
  • Private and secure: n/a for the threat model, no new surface. Every route delegates to the existing routine, automation and settings routes, so their permission checks and audit entries apply; non-admins get 404 for routines, the backup and automations they don't manage.
  • Cost: no model calls. Run now goes through the same run paths as before, including the over-budget hold.
  • User decides: nothing runs or changes until someone presses it; existing defaults unchanged.
  • Upgrades: n/a, nothing stored.
  • Honest: docs/schedules.md labels it built with its refine-later list (adding a schedule to an automation from the page, assistant tools, read-only rows for pollers and digests).
  • Tests (tests/api/test_schedules.py, schedules-page.test.tsx, schedules-model.test.ts, navigation test), docs (docs/schedules.md, mcp.md, api.md, automations.md, processing.md, requirements.md, README) and the OpenAPI client regenerated with make openapi / pnpm generate-client.
  • Open standards: five-field cron and IANA time zones; no new dependencies.
  • Reported in the thread with the PR link; refine-later items in docs/schedules.md.
  • Reuse: the scheduler, timers.clock_state, backups.schedule_state, the routine schedule preview and presets, and the existing routes for every change.

Generated by Claude Code

…edule and the backup

Lens's crontab: GET/PATCH /api/v1/schedules and POST /run, MCP tools schedules,
set_schedule and run_schedule, and an Automate > Schedules page to switch,
re-time and run anything on a clock.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m
@adeelahmad adeelahmad self-assigned this Oct 18, 2026
…s before

The clicks check found Admin one swipe further down on a phone with a new
nav row. Schedules now has Routines' row (the Routines page and New routine
open from its top), the routine-create journey goes through it, and
isActive marks Schedules on /routines pages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m

Copy link
Copy Markdown
Owner Author

Clicks and keystrokes per feature is red on the phone run: person-add +1 swipes, namespace-create +1 swipes. The new Schedules row in the nav pushes Admin below the first phone screen, so reaching it takes a swipe. That is this PR's doing.

The fix is ready and validated (jest, tsc, lint, requirements): Schedules takes the row Routines had, the Routines page and New routine open from the top of Schedules (so routine-create stays at 2 clicks), and the nav is the same length as before. It is held, not pushed, because work on Lens is paused except the feature list; it lands the moment the pause lifts.


Generated by Claude Code

An empty Schedules page had New routine twice (the header and the empty
state), which made the routine-create clicks journey's link ambiguous.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m
# Conflicts:
#	fastapi_backend/app/api/mcp_tools.py
# Conflicts:
#	fastapi_backend/app/api/v1/router.py
#	nextjs-frontend/app/openapi-client/index.ts
#	nextjs-frontend/app/openapi-client/sdk.gen.ts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m
… built

#400 shipped in v0.15.0, so its In progress line failed make requirements on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m

Copy link
Copy Markdown
Owner Author

Clicks and keystrokes per feature failed on b76d632 because of a single journey: first-question on the computer run. Its answer never arrived within 60s, and every other journey passed, including all of them on the phone. The screenshot artifact shows the question saved with "No answer was saved for this question". The backend log shows POST /api/v1/chats/1/messages returning 200, and after that no answer is ever saved.

This is not caused by this PR, which doesn't touch chat. The same failure, an answer timing out after 60s, hit chat-ask on another PR's run (39108209701) at the same time. No fix exists yet. I re-ran the failed job once and flagged the chat flake so it gets its own fix.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwZdhpvjjidN5Y45CLSi8m
@adeelahmad
adeelahmad merged commit 4519fcf into main Oct 18, 2026
11 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-hf7zaq branch October 18, 2026 09:39
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.

2 participants