Repository navigation
feat: start sessions on a schedule, or when another tool asks - #229
Merged
kalaspuff merged 15 commits intoOct 23, 2026
Merged
Conversation
Projects keep schedules: a task fctl starts a session for on its own, once at a set time or again and again (a cron expression in a time zone), on the Claude subscription of the person it runs for. D1 keeps them and their runs; a new Durable Object, ScheduleObject, sets its alarm for the earliest and takes up the ones that are due. A due run is skipped while its owner's plan is at its limit, or while the schedule's last session still works; fctl pauses a schedule whose owner can no longer run it, saying why. People and access tokens run a schedule now, on their own subscription, with what an integration knows of why it runs, which its agent reads as information.
fctl schedules lists a project's schedules; add, edit, pause, resume and rm keep them, run starts one's task now (with --context for what an integration knows), and runs lists what each run started. Schedules are found by id or name; --at takes how far ahead or a time with its offset, and --tz defaults to this machine's zone. Cron descriptions now say every 15 minutes or every 2 hours, and a schedule that runs once and waits for its owner's plan says so.
Each project gets a Schedules tab: what schedules are, with ideas to start from (dependency updates, issue triage, tidying the memory, learning from the week's reviews), then the project's schedules, each with when it runs next, what its last run did, its task, settings and runs, and Run now. The form reads as a sentence: Every [weekday] at [09:00], on chosen days, once on a day and time with quick picks, or a cron expression explained in words, in your time zone or another, with its next runs as you choose. The task box carries the composer's model, effort and GitHub pickers, and the Sessions tab's task box hands its task to it (Schedule). Sessions that a schedule started link to it, and the transcript shows fctl's note about the run apart from the task.
An error after the alarm moved a schedule to its next time (a failed D1 read in the owner's check, say) left no run behind, so a schedule that runs once showed as done without having run. Such errors are now recorded as a failed run, with the reason.
A schedule without a time runs only when someone runs it, here or with fctl schedules run, or when another tool does with an access token: a task saved for its case, such as an issue tracker sending an issue to triage. The form's When asked, and fctl schedules add --when-asked, set one up; each run starts on the subscription of whoever runs it. Each schedule's details show the request another tool sends, ready to copy. Pausing a schedule now stops runs that people and tools ask for too.
The architecture describes schedules, their alarm, runs and who pays for them; the automation guide shows how to set them up and how an issue tracker or another tool starts agents by running one with what it knows; the CLI reference lists fctl schedules; ADR 0042 records why. The data export includes the schedules someone set up or that run on their subscription, and the security notes say what to keep in mind about text that tools send with a run.
A paused schedule's row offers Resume where Run now would be, so rows keep their shape; a schedule that runs once says when it runs next only where it waits past its time; long names wrap on phones.
From a review of the schedules: - Cron descriptions take a star-led day field with a step (*/2) as restricting the days, as Vixie cron does: 0 9 */2 * * no longer reads every day at 09:00, nor shows as every day in the web form. - A schedule that runs once runs beside a session of its own that still works, rather than skip its only time. - Reset times from sandboxes' usage readings are held to a week ahead, and the cron arithmetic saturates, so no reading can overflow it. - The alarm claims a run only as it read the schedule (updated_at), and a change writes when it runs, and whether it is paused, only when it asks to: a rename no longer takes back what the alarm did meanwhile. - A wake moves the alarm only earlier. - Only the plan's own limits keep runs back, not a model's weekly one. - What a tool sends can't close the <context> block it goes in.
…line The avatar, Run now and the menu of a schedule's row are one group, centered on the name's line, with the action button as wide in every row, so the avatars make a column. The intro's point with code in it is one block of text. On phones, the Sessions tab's task box keeps its controls on one line down to 360 px, with a model named by its ID and the GitHub picker: narrower gaps, no spacer, the Schedule button as its symbol and a narrower model picker. The web app describes cron expressions with the same day rule as the control plane.
…ent-https-github-com-hyperst # Conflicts: # docs/adr/README.md
…ent-https-github-com-hyperst # Conflicts: # ROADMAP.md # docs/adr/README.md # docs/architecture.md # web/src/components/session/transcript.tsx
#228 gave UserMessage an optional follow_up, which a schedule's first message never carries.
…on one line The Agent Floor's task box gets the project task box's Schedule, as one button both share (ScheduleButton). There it is its symbol alone and shows from xl only: measured against the same row without it, at every width from 360 to 1920 px, with a model named by its ID, the GitHub picker and two workspaces' labels, it adds a line nowhere from xl and somewhere in each narrower range. The project's own task box has it at every width. The draft the Agent Floor keeps is forgotten once a schedule is set up with it, and stays when the form is cancelled. On a phone the Agent Floor's row no longer wraps: with the GitHub picker and a model named by its ID it put Start on a line of its own from 402 px down, and the pickers too at 360. Now the project's and the model's names give way where it runs out of room; the effort level's and GitHub access's symbols never shrink.
This comment has been minimized.
This comment has been minimized.
A schedule asked for no GitHub access stored none, which means the project's as each run starts, whatever the token that set it up allowed; and a change that left the access out kept the one stored. A token held to comment or read on GitHub could so set up, or rewrite the task of, a schedule whose timed runs push. Since #209 a token that does everything (which setting up or changing a schedule takes) can't be made with a cap, so only tokens made before it could; the rule holds anyway, as it does for running one. Setting one up, changing it, resuming it and taking it over with a capped token now keep its access within the cap (fctl_domain::schedules::github_within); pausing it changes nothing.
kalaspuff
approved these changes
Oct 23, 2026
kalaspuff
deleted the
fctl/160-let-s-implement-https-github-com-hyperst
branch
October 23, 2026 13:50
kalaspuff
pushed a commit
to hyperstructure/fctl-site
that referenced
this pull request
Oct 23, 2026
) fctl's projects get schedules (hyperstructure/fctl#229, for hyperstructure/fctl#9): tasks that start sessions on their own, once, again and again, or when a person or another tool asks. This brings the privacy policy in line with what app.fctl.sh then keeps: - **The short version**: projects' schedules are among what app.fctl.sh stores. - **What we collect**, a new **Schedules** item: - Each schedule's name, task, timing and session settings. - Whose Claude account it runs on, and who set it up and changed it. - Why it is paused, when fctl paused it. - For each run: when it was due and started, what started it and the session it started, or why it started none. - What a person or a tool sends with a run goes into the session's first message, and so into its transcript. - **How long we keep it**: a schedule until it or its project is deleted, and its newest 100 runs. Deleting your account leaves the schedules you set up in their projects, without your Claude account to run on. The `updated` date is already today's. `npm run check` passes; its two warnings are on `main` too. Session: https://app.fctl.sh/s/ses_01M5M5BZQ6FV77CZ7Z23YMWJAQ --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff
pushed a commit
that referenced
this pull request
Oct 23, 2026
) Attaching a file to a task and pressing **Start** took the file out of the form as soon as its upload was done. It vanished while the form said "Starting", until the session page opened, although the session got it all along. Now the form keeps showing its files until the session page replaces it. ## What changed - **A start form keeps its files while it starts** (Home and a project's Sessions tab). `useAttachments`' `take` gets a `stay` option: the start hands the files to the new session, and the form goes on showing them. The session composer still empties as it sends, since its message shows the files in the transcript at once. The form frees the files' previews when it goes away; before, the start freed them as soon as the session existed. - **While it starts, the files can't be removed and the paperclip is disabled.** Pastes and drops were already ignored then, and the pickers disabled, since files removed or added at that point don't change what the session gets. `DraftTray` takes `readOnly` and `AttachButton` takes `disabled`. `IconButton` now looks disabled when it is, like `Select` (none was disabled before). - **If the start fails**, the files are the form's again, with their remove buttons, and Start sends them again without uploading them again. On Home, uploads of kept files are dropped once a session starts with them, as before. ## A bug this found on the way `take` removed the files it took by object identity. A file sent while it was still uploading gets a new object when its upload finishes, so `take` missed it: the file stayed in the composer and, because its upload had been handed over, uploaded again. In the session composer, a file sent with a message mid-upload stayed behind, ready to go out with the next message (two uploads of one file, in the browser). `take` now goes by the files' keys, and puts them back as uploaded if sending fails. ## Screenshots At 608f8ce (with main merged in, so the forms have #229's Schedule button), with an image attached (a drawing made for this) and the request that starts the session held in the browser, so that the form stays on "Starting". Home, dark theme, 1440 px wide: | Before | After | |---|---| |  |  | A project's Sessions tab, light theme, 1440 px wide: | Before | After | |---|---| |  |  | A phone, 390 px wide, dark theme. Touch screens always show a file's remove button; while the form starts, the file now stays without it: | At rest | Starting, before | Starting, after | |---|---|---| |  |  |  | At rest, the forms look as they did on main (pixel for pixel, apart from the moving scene behind Home's header). ## How I verified it - **Unit tests.** `attachments.test.tsx` covers: - files that stay as a session starts, also when it starts mid-upload (one upload); - files that can be sent again after a failed start; - kept uploads and previews let go once a session starts; - a message's files that leave the composer when sent mid-upload, upload once and come back uploaded; - the read-only tray. `start.test.tsx` checks that a start asks for `stay` and frees no previews. The five new attachment tests fail with main's `attachments.tsx`. `cargo xtask check web` passes. - **In the browser**, with `cargo xtask dev` and Playwright, holding requests to slow them down: - **Home and the project page:** while the form starts, the image stays, without its remove button, and the paperclip is disabled. The session opens with the image in its first message, after one upload. - **A start that fails (503):** the toast shows and the image is back with its remove button. Start again opens the session without a second upload. Back on Home, the draft is gone. - **Start pressed mid-upload:** one upload (main: two). - **The session composer, a message sent mid-upload:** the composer empties once the upload is done, after one upload, and the message shows the image. On main, the file stayed in the composer and uploaded again. ## Merging main #229 merged while this was open, and changed the lines around `<AttachButton …>` in `web/src/routes/home.tsx` and `web/src/routes/project.tsx`. 608f8ce merges main in, keeping #229's lines and adding `disabled={starting}` to the paperclip. I ran the browser checks above again on the merged code, with the same results. Session: https://app.fctl.sh/s/ses_01M5MFKE7Q1K3E7855Q7CS1R9V Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff
pushed a commit
that referenced
this pull request
Oct 23, 2026
When fctl's review agent posts findings on a pull request that one of fctl's agents opened, fctl passes them on to that agent in a message (#225). The session's transcript showed that message whole: each finding's explanation, then the instructions for the agent and the `gh api` command it answers with. A single finding took most of a page, and several took more. People rarely need to read all of that, so the transcript now shows the review in a few lines, with the whole message a click away. ## What changed - **The message carries the review it is about** (`UserMessage.review`, a new `PassedOnReview`), as follow-ups carry theirs (`UserMessage.follow_up`, #228). It holds the pull request, the commit, the review's summary and session, and for each finding its severity, title, file and lines, and its comment on GitHub. `fctl_domain::reviews::passed_on_review` builds it from the same `Found` as the message's text, in the same order (most severe first, through a shared `order`). The agent gets the same text as before. - **The transcript shows it in a few lines**, styled like a follow-up's failed checks: "fctl's review agent found 2 issues in web#12 at 3f2a1c9", then one line per finding (its title, then its severity and `path:lines`). Each finding's title opens its comment on GitHub, or the review's summary for a finding on lines the diff doesn't show. **What fctl told the agent** opens the whole message. The agent's name opens the review's session, the pull request opens the review's summary, and the commit opens the commit. - **Findings messages sent before this change** have no review in them. They show their first five lines with a **Show all** button. Only these get cut: they are recognized by the words `passed_on` starts them with. Other messages from fctl stay whole, including a scheduled run's task (#229, which sends it as a message from fctl), and so do people's messages. ## Compatibility All additive, no migration. `UserMessage.review` is optional, and clients without it show the message's text as before. The internal `/review-findings` body's new `shown` field defaults to nothing. Neither hosts nor agents read the field. ## How I verified it - **Unit tests** cover the proto wire format, including a message without a review. In the domain, they check that `passed_on_review` lists findings in the message's order and links each by where it is on GitHub: its comment, the summary, or nothing known. Web tests check the findings view (lines, links, one issue, no summary, the message a click away), the transcript (a review goes to the new view, old findings messages get cut, and a short task, a long scheduled task and people's long messages stay whole), and that the builder keeps the review on its item. - `cargo xtask check` passes. One run failed in xtask's `runs_a_throttled_command_again`, an intermittent race in tests from #230 that this branch doesn't touch (#232); the rerun passed. - **End to end in `cargo xtask dev`**, through a temporary route I didn't commit. It hands made-up findings to SessionObject's `/review-findings` as `pass_on` does: the real `passed_on`, `held_back` and `passed_on_review`, the internal call, and the stored event. A session got the finding from the screenshot in the request, and the message's text came out identical to it. fake-claude answered it, and the page showed the review in a few lines. The stored event carried the review (`GET …/events`). An `fctl` binary built from main printed the same event with `fctl logs --json`, without the field, so older clients read it as before. A message sent without the review, like one from before this change, showed its first lines and opened with Show all. I didn't run posting on GitHub, `spots` or `pass_on`'s choice of session against a GitHub stand-in. This change leaves them as they were, and their tests cover them. ## Screenshots From `cargo xtask dev` at 444dfee (the views haven't changed since), with fake-claude's answer after each message. The pull request and finding are the ones from the screenshot in the request. **The message from the request**, light, 1440 px wide: | Before | After | |---|---| |  |  | **On a phone** (390 px): | Before | After | |---|---| |  |  | **Dark:**  **Three findings**, most severe first: one on lines the pull request deletes ("old version"), and one in the review's summary:  **What fctl told the agent**, opened:  **A findings message sent before this change**, which has no review in it:  Session: https://app.fctl.sh/s/ses_01M5MFGRENHK8PHRFQXJ53360Z --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9
Projects get schedules: a task fctl starts a session for on its own. A schedule runs once at a set time, again and again, or only when asked. Repeating ones run every hour, day, weekday, week or month in a time zone, or on any cron expression. Other tools start agents by running a schedule with what they know of why. So issue trackers like Linear, Jira and ClickUp can start agents today with one request, and a built-in integration gets a place to plug in later.
What changes
Schedules (
schedulesandschedule_runsin D1; ADR 0044, architecture)Starting agents from other tools
POST /api/v1/schedules/{id}/runsruns a schedule on the caller's subscription.context: what the tool knows of why it runs, such as an issue's text.<context>, marked as information and not instructions.The alarm
ScheduleObject(wrangler migrationv4) keeps one alarm for the earliest next run, which D1 keeps per schedule. The hourly cron trigger would run up to an hour late, andwrangler devruns no crons. Alarms ring on Cloudflare, in the standalone server and in development.next_run_atin D1 means a retried alarm starts nothing twice. A failure after the claim is recorded as a failed run, so a one-off never looks done without having run. The hourly job re-arms the alarm in case a wake went missing.fctl_domain::cronreads Vixie cron: five fields, names, steps,@dailyand the like, and Vixie's day-of-month/day-of-week rule. It finds next runs as wall-clock times in a zone.Intl, as browsers do, so the wasm carries no time zone database.web/src/lib/schedules.ts).Web app
xl(1280 px) up. Narrower, it would push Start or the pickers onto another line, so there the project's own task box has it. The Agent Floor's draft is forgotten once a schedule is set up with it, and stays when the form is cancelled.CLI
fctl schedules:add,show,edit,pause,resume,run --context,runsandrm. It finds a schedule by id or name.addtakes--cron,--at 2h(or an RFC 3339 time) or--when-asked, and--tz, which defaults to the machine's zone.Docs
Screenshots
At 2a76dbd, from
cargo xtask devwith its data, in a 1440 px window unless noted.What a project without schedules shows, with ideas to start from:
A project's schedules, one of them open, in the light and the dark theme: when each runs next, what its last run did, a paused one, a one-off and one that runs when asked.
Setting one up from an idea: the sentence form, the day toggles and the next runs:
On a phone (390 px):
A schedule that runs when asked, with the request another tool sends:
Its run's session, started with curl and a tool's context. The header and the rail link to the schedule, and the transcript shows fctl's note apart from the task. The context sits inside
<context>, marked as information, here with an instruction that tries to steer the agent:The Sessions tab's task box, with Schedule beside Start, in the light theme:
The same task box on an iPhone 16 Pro (402 px), in the worst case: the GitHub picker shows (the project has a repository) and the model is named by its ID. Everything stays on one line, as it does down to 360 px:
The Agent Floor's task box at 1440 px, with Schedule as its symbol between ⌘+Enter and Start, in both themes:
The Agent Floor's task box on an iPhone 16 Pro (402 px), in the same worst case. Before, on
main, the pickers and Start take a second line:After: one line, with the model's ID cut short. Schedule isn't on the phone row; the project's own task box has it:
How I verified it
fctl-domaincron: parsing and its errors, descriptions, next runs in UTC and in Stockholm across both summer-time changes, the Vixie day rule, gaps.fctl-domainschedules: when a schedule runs, its state, names, zones, context, who may do what, plan limits and the run note. Also the routes limited tokens reach.lib/schedules.test.ts: the same descriptions as Rust's, next runs withIntlacross summer time, the form's round trips, the run-note split and names.cargo xtask dev, with the CLI, curl and the browser:cargo xtask serve): its migrations applied,cargo xtask dev --smoke --serverpassed, and a schedule fired there on time.schedules.test.tsxcovers the same, and the button's states.0 9 */2 * *) read as every day, and the form would have rewritten them on save.<context>block.All of these are fixed, with tests.
schedules::github_within). It has a test, and I checked it incargo xtask devwith such a token.cargo xtask checkandcargo xtask dev --smokepass.Compatibility
Session.schedule, new types), and older CLIs and web apps ignore them.v4, and apply D1 migration0028before the Worker.Left for later
Session: https://app.fctl.sh/s/ses_01M5M5BZQ6FV77CZ7Z23YMWJAQ