Skip to content

I want to build a smart job scheduler for our managers and staffs... Type of jobs: - Single Run: Jobs such as check logs for the day and report anomaly. They do not have memory or reference. - Continuous Run: Jobs such as "create an episode on some theme every day at x time". Because each new episode must remember what happened before they must have memory and references. How can we design it?? Just prepare a plan doc - #27

Merged
ayyshim merged 7 commits into
mainfrom
canopy/i-want-to-build-a-smart-job-scheduler-for
Nov 21, 2026

Conversation

@ayyshim

@ayyshim ayyshim commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Handover: smart job scheduler plan (G-29)

What you asked for

You asked for a plan doc for a job scheduler for managers and staff, covering two kinds of jobs:

  • Single run: for example, "check today's logs and report anything odd". Each run starts fresh, with no memory.
  • Continuous run: for example, "write a new episode on this theme every day at 9". Each run has to remember what the earlier runs did.

You asked for a plan only, with no code.

Later, while reviewing this handover, you asked for a clickable prototype of the scheduler flow. That's new build work, so a staff member should do it, not the manager (N-65). It will be a follow-up goal: Tommy builds it and Trevor reviews it. It isn't part of this goal, and no prototype is attached here. See "What you need to decide" below.

What we made

Three new documents. No code changed.

File What it is By
docs/design/job-scheduler.md The plan. You already approved it (T-173). Tommy
docs/design/job-scheduler-findings.md How Canopy runs work today, and which parts a scheduler can reuse (T-171) Tommy
docs/design/job-scheduler-research.md How other schedulers handle timing and how AI agents keep memory between runs, with a recommendation for each point (T-172) Trevor

Trevor reviewed all three against the real code (T-174) and fixed a few wrong claims. Everything is on the branch canopy/i-want-to-build-a-smart-job-scheduler-for: 7 commits, each with a plain message and no Claude co-author line.

The plan in short

A job is a saved instruction with a schedule and an owner. When a job is due, Canopy starts a run. A run is an ordinary goal. That means the board, outputs, notifications and usage tracking all work for it without changes.

The two job types differ in only two ways: what the agent is given at the start of a run, and whether the run may save memory.

  • A single run gets only the instructions people wrote (the brief).
  • A continuous run also gets its memory:
    • Brief: written by people. Agents never change it.
    • Rolling summary: the agent rewrites it after each run, and people can edit it. It's stored as a note, so earlier versions are kept.
    • Run log: one line per earlier run. The agent sees the newest 10 and can open older runs and their files when it needs them.

Memory is saved only when a run succeeds. If a run fails partway through, memory stays exactly as it was. The summary is capped at about 5,000 characters. When it gets too long, the agent has to shorten it before it can save, so memory doesn't keep growing.

Two ways to do the work:

  • Direct (the default): the run goes straight to one staff member. This is cheap because no manager plans each run.
  • Planned: the manager plans every run. This is for big jobs.

Timing rules:

  • Hub down at the due time: the run is skipped, or run once late if it's still within a set window. A pile of missed runs is never replayed.
  • No overlap: a run never starts while the previous run of the same job is still going.
  • Run now and Test run don't change the schedule, and a test run never saves memory.
  • Pausing: a job pauses itself after 3 failed runs in a row. It also stops a run that uses more tokens than its per-run limit.

Notifications stay quiet unless there's something to say. A daily check that finds nothing sends nothing.

Screens:

  • A Jobs page.
  • A "Create a job" dialog. It always shows the next 5 run times in plain words, so a wrong time or time zone is easy to spot.
  • A page for each job, with Runs and Memory tabs.

Phases:

  1. Both job types in Direct mode.
  2. Retries, monthly caps and more safety features.
  3. Smarter features, such as agents suggesting new jobs.

How to check it

  1. Open docs/design/job-scheduler.md on the branch. For a quick read, sections 1, 3, 8, 13 and 14 cover the essentials.
  2. Run your two examples through section 3, which shows one full run of each type. Check that the daily episode would really know what the earlier episodes did.
  3. Read the 11 open questions in section 14. Each has a recommended answer. These are the decisions below.
  4. To see the change: git diff main...canopy/i-want-to-build-a-smart-job-scheduler-for. It should show 3 new files under docs/design/ and nothing else.

What isn't done, and the risks

  • Nothing is built. This is a plan only.
  • No prototype yet. The clickable prototype you asked for is waiting on a follow-up goal for Tommy, with Trevor reviewing. I can't hand out tasks from this handover, so the goal needs to be started on the board.
  • The research wasn't checked against its sources. Trevor wrote it from what he knows of the official docs and did not reopen the links. Check exact defaults before copying any behavior.
  • Some building details are still open:
    • Goals have no "stopped" status, so a run that's cancelled or hits its limit has nowhere clean to go.
    • How Canopy stores attached files hasn't been checked. This only matters for phase 2.
    • Nobody has tested how the time library handles daylight-saving changes.
  • Some existing code has to change. Today, every finished goal waits for a person to approve a handover. Job runs must skip that step, or every run would stall. That code is shared with normal goals, so it needs careful tests.
  • Runs need the owner's computer to be on. A run uses the owner's computer, as goals do today. If that laptop is off, the run is skipped. A job can be moved to a shared computer to avoid this.
  • Plain-text schedules are limited at first. "Every weekday at 9" is read by a small built-in rule set, not by AI, so only common phrases work in phase 1. A picker and a "raw schedule" field cover the rest.
  • Agents can't ask questions during a run. Nobody is watching, so a run that stops to ask a question will time out and fail.
  • The board gets crowded. A daily job adds 365 goals a year. The plan hides finished job goals and adds a filter in phase 2.
  • Bad memory carries forward. If an agent writes a wrong fact into memory, later runs build on it. Earlier versions, a snapshot after each run and a "Reset memory" button make this fixable, but someone has to notice.
  • Time zones are per organization only. Jobs default to the organization's time zone. People can't set their own yet.

What you need to decide

  1. The prototype follow-up goal: please start a new goal for Big Mac, for example “Clickable prototype of the job scheduler flow”, built by Tommy and reviewed by Trevor. What it could cover, all taken from the plan:

    • the Jobs list;
    • the four-step “Create a job” dialog, with the plain-text schedule box and the next 5 run times;
    • a job page with Runs, Memory and Settings tabs;
    • one run played step by step for each job type: the checks, the goal it makes, what the agent is given, the report, memory saved only on success, and the notification;
    • “what if” cases: a failed run, a skipped run, Canopy being down, the laptop being off, going over the token cap, memory that's too long, and pausing after 3 failures.

    Add or remove anything when you start the goal.

  2. Merge: can these three docs go to main?

  3. The recommended answers in section 14. Do you agree with them? The ones with the most effect:

    • Each run is a full goal, not a lighter kind of task.
    • Job runs skip the handover approval. The run's summary is the record.
    • Phase 1 reads plain-text schedules with simple rules, not AI. AI comes in phase 3.
    • Add a "stopped" goal status for cancelled runs and runs that hit their limit.
    • At most 2 job runs at once per computer, so ten jobs due at 9:00 don't all start together.
  4. Building phase 1: after the prototype, should we open another goal to build phase 1, with both job types in Direct mode?

  5. Where jobs run: should jobs run on a shared computer by default, so they still run when laptops are off? Or on the owner's computer, as goals do today?

@ayyshim
ayyshim merged commit 015e7c5 into main Nov 21, 2026
2 checks passed
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.

1 participant