Repository navigation
feat(autopilot): hold its messages until its session limit has room - #556
Merged
kalaspuff merged 7 commits intoNov 15, 2026
Merged
Conversation
… has room A message from an autopilot to one of its sessions that rests, while as many of its sessions work as its people allow, no longer fails: the control plane keeps it in D1 (autopilot_held), in the order it was sent, and sends it once one of its sessions ends its turn, stops or fails, as SessionObject reports the move, or at the autopilot's next wake. fctl send says it is held, fctl autopilot held lists those held and takes one back, and the briefing and brief say so.
ADR 0081 records why fctl holds them rather than let them through, and the architecture, API, CLI and llms.txt describe held messages.
This was referenced Nov 15, 2026
docs(legal): say what app.fctl.sh keeps of an autopilot's held messages
hyperstructure/fctl-site#125
Merged
…pilot-s-messages-wait-for-roo # Conflicts: # docs/llms.txt
This comment has been minimized.
This comment has been minimized.
After a held message fails to reach its session, those held for that session after it wait for the next pass rather than overtake it, and a held message that fails to be dropped no longer stops the pass, as fctl's review of #556 found.
kalaspuff
pushed a commit
to hyperstructure/fctl-site
that referenced
this pull request
Nov 15, 2026
…es (#125) ## Summary An autopilot's message to one of its sessions that rests, while as many of its sessions work as its people allow, now waits on app.fctl.sh until one of them makes room, rather than being refused. The privacy policy now says what is kept of each such message: its text, its files' names, types and sizes, the session it goes to, the person the autopilot acts as and when it was sent. It also says how long: until the message goes to its session (and into that session's transcript), someone takes it back, its session is deleted or the project is taken off autopilot, and however long the autopilot is paused. And it says who sees it: the account the autopilot runs on (its brief shows the start of each) and the project's members (its autopilot view). `updated` moves to 2026-11-15. - hyperstructure/fctl#556 [fctl session](https://app.fctl.sh/s/ses_01M7FBR91XMD2RC1EXPNDF9A4D) <!-- FCTL_REVIEW_SUMMARY --> --- > [!NOTE] > **Low risk.** Only the privacy policy text changes, plus a bump of the pinned fctl docs reference. > > **What it does.** Updates `legal/privacy.md` to say what app.fctl.sh keeps of the messages an autopilot holds for its sessions while its session limit is full: what is stored, that their start goes to the Claude account the autopilot runs on, that project members see them, and how long they stay. It also bumps `fctl-docs.ref` to a newer fctl commit. > > **Retention wording.** The policy now says a held message waits however long the autopilot is paused, and is dropped for a failed session only once the autopilot is next on; this follows fctl#556, which is not merged yet. > > <sub>[fctl review](https://app.fctl.sh/s/ses_01M7FFXYRAJFBZN827511TWS4B)'s first look at [`305d009`](305d009) · 1 file, +18 −7 · [Review agent settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub> <!-- /FCTL_REVIEW_SUMMARY --> --------- Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
…pilot-s-messages-wait-for-roo # Conflicts: # crates/fctl-control/src/autopilots.rs # docs/architecture.md # docs/llms.txt
A pass now claims a held message (autopilot_held.sending_at) before it sends it, and sends only what it claimed; taking one back deletes it only while no pass has, and answers 409 once it is going out. The migration is 0063 now, after main's 0061 and 0062. As fctl's review of #556 found.
This comment has been minimized.
This comment has been minimized.
A held message that a pass finds gone (taken back meanwhile) no longer holds back those after it to its session; only one another pass is sending does, as fctl's review of #556 found.
kalaspuff
approved these changes
Nov 15, 2026
kalaspuff
deleted the
fctl/1291-let-an-autopilot-s-messages-wait-for-roo
branch
November 15, 2026 12:08
4 tasks
kalaspuff
pushed a commit
that referenced
this pull request
Nov 15, 2026
…rts (#558) ## Summary An autopilot can now attach files to the sessions it starts and steers (`fctl run --attach`, `fctl send --attach`) and read the files sent in the sessions it reads, with a new `fctl files list` / `fctl files get` (for people too). Files like the .3mf and .stl models of the 3D printing autopilot then pass from a person to one session, and from there to another, without anyone attaching them again. - **Relay:** the autopilot's `fctl` sends a file to fctl-agent in base64 as a new `AgentCall::ApiBytes`, and the host posts the bytes as they are to a new runner endpoint, `POST /api/v1/runner/sessions/{id}/relay`. The Worker routes them as the JSON relay does, as the autopilot's owner, but streams the body in and the answer out, so a 20 MB file never goes into wasm memory. Only uploads and downloads of files go this way (`fctl_domain::autopilot::carries_files`), and the JSON relay refuses them. - **What it may do:** it uploads for a session it starts (`Gate::Open`) or one it started (`Gate::Crew`), and reads the files of the sessions it can read. `GET /api/v1/sessions/{id}/attachments` (new) lists a session's files, leaving out those of an autopilot's messages fctl still holds for room (#556). A held message that never goes hands its files back as unsent uploads, which are deleted a day later. - **Its instructions:** where its sandbox's `fctl` has `fctl files`, its `~/AGENTS.md` tells it to attach files rather than publish screenshots for its sessions. It still publishes to show people an image in what it asks them. I checked it with unit tests (the gate, which requests carry files, fctl-agent passing them on only from an autopilot's own session, the `~/AGENTS.md` text, picking files by name) and in `cargo xtask dev`. There, the fake autopilot started a session with a 3 MB model attached. It then downloaded a 19.5 MB file a person had sent that session and attached it to another of its sessions. The sha256 matched at every step. Its attempt to attach a file to a person's session was refused. Runners a version behind keep working: their fctl-agent refuses `ApiBytes`, and `fctl` says the runner needs a newer fctl. The autopilot's `~/AGENTS.md` keeps telling it to publish screenshots until its sandbox's `fctl` has `fctl files`. The session socket now takes requests of up to 32 MiB (it was 8), enough for a 20 MB file in base64. Crew sessions still send the autopilot no files, as Carl Oscar decided: what one makes for another (a sliced .gcode.3mf, say) goes on its branch, or as a screenshot it publishes, and the autopilot's instructions say so. ## Worth confirming - **Decision:** the autopilot reads the files of every session it can read, people's sessions in its places too, as it already reads their transcripts. It uploads only for sessions it starts or started. - **Decision:** uploads and downloads add no line to the autopilot's log. The message or session that sends the files gets its usual line. - **Decision:** `fctl files get SESSION NAME` takes the newest file of that name and writes it into the current directory (or `--dir`), but over no file already there unless `--force`, as the names are whoever sent the files'. `--all` takes the newest of each name, and an older one is reached by its id. - **Decision:** `AgentCall::ApiBytes` is a variant of its own, not optional fields on `AgentCall::Api` as the issue suggested. An older fctl-agent refuses an unknown variant, where it would silently drop new fields and send an empty upload. - **Assumption:** the name `fctl files` (the files sent in a session) reads clearly beside `fctl autopilot files` (the autopilot's own text files, from #555). The autopilot's instructions tell the two apart: attachments go to its sessions, while its own files are what it keeps for its next session. Fixes #517 [fctl session](https://app.fctl.sh/s/ses_01M7FBVEK6V85B5J3NNR92Z2QB) <!-- FCTL_REVIEW_SUMMARY --> --- > [!NOTE] > **Medium risk.** It adds a runner endpoint that streams file bodies to the API as an autopilot's owner, a new `AgentCall::ApiBytes` variant with its own permission gate, and raises the session socket request limit from 8 to 32 MiB. > > **What it does.** Lets an autopilot attach files to the sessions it starts and steers (`fctl run --attach`, `fctl send --attach`) and read files in sessions it can read, through new `fctl files list` and `fctl files get` commands. Files travel from the autopilot's `fctl` through fctl-agent as base64 in `AgentCall::ApiBytes`, then through a new runner relay endpoint to the API, and a new `GET /api/v1/sessions/{id}/attachments` lists a session's files. Uploads are allowed only for sessions the autopilot starts or started, while downloads cover every session it can read. `fctl files get` downloads into hidden part files, created as new files only, and puts them in place once every download came, writing over no existing file unless `--force`. > > **Permission gate.** The autopilot can read the files of every session it can read, including people's sessions in its places, but upload only to sessions it starts or started. > > <sub>[fctl review](https://app.fctl.sh/s/ses_01M7FKG4NZ1MV4MBWA62K7KBRB)'s first look at [`a8071f1`](a8071f1) · 32 files, +1564 −83 · [Review agent settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub> <!-- /FCTL_REVIEW_SUMMARY --> --------- Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
5 tasks
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.
Summary
An autopilot's message to one of its sessions that rests no longer fails while as many of its sessions work as its people allow. The control plane keeps it in D1 (
autopilot_held) and sends it as soon as one of its sessions ends its turn, stops or fails, those held going out in the order the autopilot sent them. This replaces thesend-when-free.shscripts autopilots wrote to pollfctl send, which a fresh session lost at each handover. ADR 0081 records why fctl holds such a message rather than let it through: nothing tells how much a message will set going.POST /sessions/{id}/messagesfrom an autopilot answers withheld(itsaph_…id and how many go before it) and the delivery it later goes out as. A message to a session that works goes at once. One to a resting session waits behind messages already held, as does any message to a session that has held messages waiting. At most 30 are held per autopilot. A retry of the same request finds the one already held.fctl sendsays "Held: it goes to shop#41 once one of your sessions ends its turn, stops or fails…".fctl autopilot heldlists the held messages (andfctl autopilotshows them), and--take-back <id>takes one back, for the autopilot or those who steer it, until a pass claims it to send it (then409). The briefing tells the autopilot not to send a held message again, and the brief lists held messages under its sessions.Verified with unit tests of the hold and release rules, wasm tests of the D1 queries against the D1 stand-in (what waits, what goes, claiming one to send and taking one back), and
cargo xtask check lint. I also drove a fake-claude autopilot incargo xtask devwith a limit of one session, and saw:fctl resumeat the limit still refused, with its new wording.The privacy policy on fctl.sh says what is kept of held messages and for how long:
Refs #550:
fctl run --when-free(holding a new session's start) isn't part of this; see Worth confirming.Worth confirming
fctl resumeof a failed session andfctl runstill fail at the limit, with the resume's refusal now pointing out that a message waits by itself. Holding a start (fctl run --when-free) would mean replaying a session's start without the request that asked for it, so I left it for a follow-up, should autopilots still need it.fctl autopilot held, the API'sheld) and take them back. The web app's Autopilot tab doesn't show them yet.fctl session
Note
Medium risk. It changes how an autopilot's messages to its sessions are delivered: they can now be stored in a new D1 table and sent later from the session objects, which touches session delivery and autopilot state.
What it does. When an autopilot messages a resting session while as many of its sessions work as its limit allows, the control plane now holds the message in a new
autopilot_heldtable instead of failing it. Held messages go out in the order they were sent as soon as a session ends its turn, stops or fails, or when the autopilot wakes or its limit is raised. The API, CLI (fctl autopilot held,--take-back), the briefing and the generated web types are extended, and ADR 0081 records the decision. A pass claims each held message (sending_at) before sending it, and a message taken back no longer holds up later ones for the same session.New migration.
0063_autopilot_held.sqladds theautopilot_heldtable to D1, and a message from an autopilot to a session can now be answered withheldinstead of an error.fctl review's first look at
b3fccb1· 22 files, +1431 −34 · Review agent settings