Skip to content

feat: start sessions on a schedule, or when another tool asks - #229

Merged
kalaspuff merged 15 commits into
mainfrom
fctl/160-let-s-implement-https-github-com-hyperst
Oct 23, 2026
Merged

kalaspuff merged 15 commits into
mainfrom
fctl/160-let-s-implement-https-github-com-hyperst

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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 (schedules and schedule_runs in D1; ADR 0044, architecture)

  • What a schedule holds. A name, the task its runs' agents get, and when it runs. Also what its sessions start with: model, effort level, base branch and GitHub access. Unset ones follow the project's, and GitHub access never exceeds what the project allows now.
  • Whose subscription. A schedule runs on the Claude subscription of whoever set it up. The project's maintainers and owners may also change it. Their change moves it to their own subscription, and so do a resume or "Run it on my subscription". Nobody puts work on someone else's subscription.
  • Runs don't pile up. A run is skipped while the last one is still working on its task.
    • It is also skipped while the owner's plan is at its limit, as the issue asks, until the limit resets. A one-off waits for the reset instead.
    • When the owner can no longer run it, fctl pauses it and says why: they left, lost the role or have no Claude connection, or the project is archived.
  • Each run is a session named after the schedule.
    • Its first message is the task, then a note from fctl: which schedule started it, when and for whom, its previous run, and that nobody watches it start.
    • The transcript shows the note apart from the task.

Starting agents from other tools

  • Running a schedule now. POST /api/v1/schedules/{id}/runs runs a schedule on the caller's subscription.
    • It takes context: what the tool knows of why it runs, such as an issue's text.
    • From an access token, the agent gets that text after the task, inside <context>, marked as information and not instructions.
    • A token that runs sessions may run schedules. Setting one up or changing it takes a token that does everything, since its sessions start after the token is gone.
    • People and tools can run a schedule 20 times an hour. Pausing it stops them all.
  • When asked. A schedule without a time is a task saved for its case. Each schedule's details show the request another tool sends, ready to copy.

The alarm

  • A Durable Object of its own. ScheduleObject (wrangler migration v4) keeps one alarm for the earliest next run, which D1 keeps per schedule. The hourly cron trigger would run up to an hour late, and wrangler dev runs no crons. Alarms ring on Cloudflare, in the standalone server and in development.
  • Each run is claimed before it starts. A compare-and-swap on next_run_at in 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.
  • Cron and time zones. fctl_domain::cron reads Vixie cron: five fields, names, steps, @daily and the like, and Vixie's day-of-month/day-of-week rule. It finds next runs as wall-clock times in a zone.
    • The control plane reads zones with Intl, as browsers do, so the wasm carries no time zone database.
    • The web app finds the same runs by the same rules (web/src/lib/schedules.ts).
    • A time the clock skips in spring runs as far past the change. A time the clock repeats in autumn runs once.

Web app

  • A Schedules tab.
    • With no schedules yet, it explains what they are and offers ideas to start from: dependency updates, triaging new issues, tidying the project's memory, and learning from the week's reviews.
    • Then it lists the project's schedules, with when each runs next and what its last run did.
    • Each schedule opens to its task, settings, next runs and runs, and the request for other tools.
  • The form reads as a sentence, such as "Every [weekday ▾] at [09:00]".
    • Weeks get day toggles, months a day of the month.
    • Once is a day and a time, with quick picks: in an hour, this evening, tomorrow morning, Monday morning.
    • Cron is a field whose expression is explained in words as you type.
    • When asked needs no time.
    • It uses your time zone or any other, and shows the next runs as you choose, also in your own time when the zones differ.
    • The task box carries the composer's model, effort and GitHub pickers.
  • Schedule button. The Sessions tab's task box gets a Schedule button that turns what you wrote into a schedule.
    • The Agent Floor's task box has it too, as its symbol alone, from 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.
    • On a phone the Agent Floor's row now keeps one line. Before, 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 at 360 px the pickers too. Now the project's and the model's names give way when the row runs out of room.
  • Sessions link back. A session that a schedule started links to it from its page and shows its mark in lists.
  • Phones. One column, the decorative preview hidden, long names wrapping, and icon-only buttons.

CLI

  • fctl schedules: add, show, edit, pause, resume, run --context, runs and rm. It finds a schedule by id or name.
  • add takes --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 dev with its data, in a 1440 px window unless noted.

What a project without schedules shows, with ideas to start from:

The Schedules tab of a project without schedules, dark theme

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.

Light Dark
The list of schedules, light The list of schedules, dark

Setting one up from an idea: the sentence form, the day toggles and the next runs:

The new schedule form

On a phone (390 px):

No schedules yet The list The form
Phone, the empty state Phone, the list Phone, the form

A schedule that runs when asked, with the request another tool sends:

A when-asked schedule's details

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 session a tool started

The Sessions tab's task box, with Schedule beside Start, in the light theme:

The task box with Schedule

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 task box on a phone, on one line

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 with Schedule, dark

The Agent Floor's task box with Schedule, light

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:

Before: the Agent Floor's task box on two lines

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:

After: the Agent Floor's task box on one line

How I verified it

  • Unit tests.
    • fctl-domain cron: parsing and its errors, descriptions, next runs in UTC and in Stockholm across both summer-time changes, the Vixie day rule, gaps.
    • fctl-domain schedules: 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.
    • The web's lib/schedules.test.ts: the same descriptions as Rust's, next runs with Intl across summer time, the form's round trips, the run-note split and names.
    • The CLI's time parsing.
  • End to end in cargo xtask dev, with the CLI, curl and the browser:
    • A one-off due in a minute started its session on time, and Run now worked.
    • A run was skipped while the last session still worked.
    • With the dev plan at its 5-hour limit, a repeating schedule skipped to after the reset, and a one-off waited for it.
    • A schedule whose owner was gone paused with its reason, and resuming it made it the resumer's.
    • A When-asked schedule ran from curl with context, and its session shows the note and the context as information.
  • The standalone server (cargo xtask serve): its migrations applied, cargo xtask dev --smoke --server passed, and a schedule fired there on time.
  • Layout, measured in Playwright.
    • A schedule row's name line, avatar, Run now and menu center within 0.2 px of each other, and every row's avatar sits at the same x.
    • The Sessions tab's task box keeps all its controls on one line at 402, 393, 375 and 360 px, in the worst case above.
    • The Agent Floor's task box keeps one line at 360, 375, 393, 402 and 430 px in that case, and for a project without GitHub.
    • Its Schedule button adds no line at any of 29 widths from 360 to 1920 px. That holds with a model ID, the GitHub picker, two workspaces' labels, and a project with neither, measured against the same row without the button.
  • The Agent Floor's Schedule, end to end: it opened the project's Schedules form with the task. Cancelling kept the Agent Floor's draft, and setting the schedule up emptied it. schedules.test.tsx covers the same, and the button's states.
  • An independent review of the backend found no authorization hole. It did find:
    • Cron expressions with a stepped star in a day field (0 9 */2 * *) read as every day, and the form would have rewritten them on save.
    • A one-off was skipped for good while a session of its own still worked.
    • A sandbox-reported reset time could overflow the arithmetic.
    • The alarm and a person's edit could race, and so could two wakes.
    • A model's own weekly limit held back runs on other models.
    • A tool's text could close the <context> block.
      All of these are fixed, with tests.
  • fctl's review agent found that a token's cap on GitHub didn't stay with a schedule it set up or changed, so the schedule's timed runs could push. Since fix: close the gaps a review found in limited access tokens #209 only tokens made before it can have both full access and a cap, but the cap now holds anyway (schedules::github_within). It has a test, and I checked it in cargo xtask dev with such a token.
  • The project's checks: cargo xtask check and cargo xtask dev --smoke pass.

Compatibility

  • Hosts and agents need no update: a schedule's run is a session like any other.
  • Protocol changes are additive (Session.schedule, new types), and older CLIs and web apps ignore them.
  • Deploys render the new Durable Object class and its migration v4, and apply D1 migration 0028 before the Worker.

Left for later

  • Retrospectives in the sandbox. Agents can't read their project's retrospectives from a sandbox yet, only their own session's. So the "learn from the week" idea reads review comments for now; the roadmap's "Learning from retrospectives" covers the rest.
  • Built-in integrations. Linear, Jira and ClickUp integrations would be triggers that run a schedule with what they received, through the same path. They are on the roadmap now.

Session: https://app.fctl.sh/s/ses_01M5M5BZQ6FV77CZ7Z23YMWJAQ

fctl-sh Bot added 11 commits October 23, 2026 11:08
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
fctl-sh Bot added 3 commits October 23, 2026 12:51
…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.
@fctl-sh

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
kalaspuff merged commit c75b70e into main Oct 23, 2026
12 of 13 checks passed
@kalaspuff
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 |
|---|---|
| ![Before: Home's form while it starts, without the image, and
shorter](https://app.fctl.sh/api/v1/published/Ole4PbwmyQIlqwXBo2n0VhxWM3ekgwuGCQ1Fij4g7hh/before-home-dark-starting.png)
| ![After: Home's form while it starts, with the
image](https://app.fctl.sh/api/v1/published/9skqgKpf5JsM9hmIbURTDoumBAuGDiCMPRzewKGOUFO/after-home-dark-starting.png)
|

A project's Sessions tab, light theme, 1440 px wide:

| Before | After |
|---|---|
| ![Before: the project's form while it starts, without the
image](https://app.fctl.sh/api/v1/published/iIRRYifuc0XmAYoBBLWDr3tEBTDJRPUAO7qCRCSDy1K/before-project-light-starting.png)
| ![After: the project's form while it starts, with the
image](https://app.fctl.sh/api/v1/published/r53NnZvT9I2lDxk34pheNoozJEb9O7T4cxH4YHGYHkR/after-project-light-starting.png)
|

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 image with its remove
button](https://app.fctl.sh/api/v1/published/xwbEQXN0QUubK0TckDR1J3drFVoq1OmOarnwY2PR14o/after-phone-dark-ready.png)
| ![Before: while starting, without the
image](https://app.fctl.sh/api/v1/published/c5s6hdLuuKBzODgyilESxpOSDjzn0hUDM7HyLUU97xL/before-phone-dark-starting.png)
| ![After: while starting, the image without its remove
button](https://app.fctl.sh/api/v1/published/4HIQuBEgogMQHC3UcQ8ccURNufPfsIWqFLZGpVK72e7/after-phone-dark-starting.png)
|

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 |
|---|---|
| ![Before: fctl's findings message in full, taking most of the
page](https://app.fctl.sh/api/v1/published/hj84xS95c5bvmd2utgEMY1qGp14QCmlXFJobpNa4dDQ/before-light.png)
| ![After: one header line, one line for the finding, and What fctl told
the
agent](https://app.fctl.sh/api/v1/published/Sv7KaTlWWLrrhz4G976yvEcixZECIG8ndKWSCGrPtR0/after-light.png)
|

**On a phone** (390 px):

| Before | After |
|---|---|
| ![Before: the message runs over several screens on a
phone](https://app.fctl.sh/api/v1/published/QwKoh1y4GzNuWodKc1DapBit9LSGjcV3KFbCcL0XM6j/before-light-390.png)
| ![After: the review in a few lines on a
phone](https://app.fctl.sh/api/v1/published/x95nhqGSdlfia0sjaxY7yRVoAGLXnkSSp3j7Fip5h6k/after-light-390.png)
|

**Dark:**

![After, dark: the review in a few
lines](https://app.fctl.sh/api/v1/published/NXNIRQW3qFYiiyykOl45CcB0c6O2zBpiauPCQ3PRQRv/after-dark.png)

**Three findings**, most severe first: one on lines the pull request
deletes ("old version"), and one in the review's summary:

![A review with three findings, one line each, on the session
page](https://app.fctl.sh/api/v1/published/Wpu8NTZ1NEUmdbBgC2gBQYUgJR9o3QNvLrHneAoBbZJ/three-light.png)

**What fctl told the agent**, opened:

![What fctl told the agent opened under the review, showing the whole
message](https://app.fctl.sh/api/v1/published/MKyPEc1MV1SonBnMLzskBYoG4UpvnQ0vxw9otdMncZR/one-told-dark.png)

**A findings message sent before this change**, which has no review in
it:

![The older message's first five lines, ending at the first finding's
title, with Show
all](https://app.fctl.sh/api/v1/published/cXussMeSJ3b0XIILwM3Ktg3cxyEkG9rxs7gKiWjc8vP/older-light.png)

Session: https://app.fctl.sh/s/ses_01M5MFGRENHK8PHRFQXJ53360Z

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Scheduled and recurring sessions

1 participant