Repository navigation
feat(autopilot): pass on another autopilot's lessons; edit plan sections - #538
Merged
Merged
Conversation
An autopilot that ran a project (spaghetti) said what it would tell every autopilot. The briefing now passes on what it didn't already say: what may merge without the autopilot's look goes in each task where sessions merge (a session that doesn't know ends its turn to ask, costing a wake); sessions that change the same screen get one shared layout and go one after the other; a spike with real numbers comes before big, uncertain work; a session tidies the memory once it grows long; screenshots go to a subagent while the autopilot looks at a crop or two, and people check right after a ship what no sandbox can; work that drives hardware needs a person at its first run; licenses that bind the project go to people; background waits use plain HTTP APIs; ships wait while people are away; a lighter model does mechanical work; one topic to an ask; and the plan reads as if a stranger took over at the next wake, with the scripts it relies on. The autopilot's plan updates once lost a session's state when a scripted replacement in a stale local copy failed silently. The briefing now says that fctl autopilot plan prints the plan as fctl has it, and fctl autopilot plan --section HEADING --file part.md replaces one section, up to the next heading of its level, failing with the plan's sections named when it has no such one.
This comment has been minimized.
This comment has been minimized.
… exactly Code indented four spaces and fences closed only by one at least as long hold no headings, and only #s after a space close one (Learn C#). A redirected fctl autopilot plan prints the plan as fctl has it, and nothing when there is none, so that writing it back changes nothing. The merge example for lighter models shows only where sessions merge.
This comment has been minimized.
This comment has been minimized.
This was referenced Nov 13, 2026
kalaspuff
approved these changes
Nov 14, 2026
kalaspuff
pushed a commit
that referenced
this pull request
Nov 14, 2026
) ## Summary Carl Oscar asked the spaghetti autopilot (on fctl 0.34.1) what it would tell any fctl autopilot. Most of its advice already reached the briefing through #538–#543. This adds what hadn't: - **Which sessions count toward the limit.** The autopilot had to guess, and guessed wrong about queued ones. The briefing, the limit's error and the docs now say: those queued, starting, working, paused on a usage limit or still stopping count, as does one just messaged; one that ended its turn, stopped or failed doesn't. With all of them at work, the autopilot keeps the next tasks in its plan and starts one when fctl wakes it for a session that ended its turn. - **Lessons.** Name sessions as the brief and wakes do, never with a placeholder or a guessed number (it sent one `fctl send` to a made-up ID). Keep the scripts the work relies on in the plan whole, and lead the plan with what a stranger must act on first. Send long output to a file and grep it. Ask for screenshots of the case that matters (a person's narrow window, their real file), not only the default. Have watchers follow the base branch's newest run when a newer merge cancels one (a cancelled run stopped its watcher, and a ship sat waiting). Look at what people send before publishing it or passing it on (one screenshot showed a `/Users/<name>/…` path), and unpack archives in an empty directory. - **`fctl autopilot brief --only sessions,people,asks`** (`?only=`) shows only the named parts: direction, notes, asks, sessions, people, plan, log. The whole brief had grown to about 32 KB, which every wake read again, though its plan and log are already in the autopilot's conversation. The briefing and wake message point to `--only`. Notes and answers in parts it leaves out stay new, so the next whole brief or wake still marks them. I verified it with unit tests (the briefing's lines, parsing and ordering the parts, a brief with two of them, the CLI's flag) and end to end in `cargo xtask dev`. An autopilot's own session ran `fctl autopilot brief --only sessions,asks` through the relay and got only those parts, and the CLI and the API refuse an unknown part, naming the parts there are. The dev stack can't show that a note left out stays new, because fake-claude reads the whole brief at every wake; that part is a filter on what the brief showed. ## Related pull requests The other gaps the autopilot named, each in its own pull request: - #546 - #545 ## Not done here - Watchers that survive a handover, for what fctl doesn't wake autopilots for (the base branch's checks, a deploy). The merge wake in the pull request above removes the most common one. - `fctl send --attach` from an autopilot (#517). Since #543, an ask that names a session sends people's files to it directly. - `fctl run --when-free`: the briefing now says the limit's rule, and a session ending its turn already wakes the autopilot. - A standard place for a pull request's screenshots, and a check in `fctl send` against IDs of other projects' sessions. An autopilot can already message only the sessions it started. ## Worth confirming - **Decision:** `--only` names parts rather than headings: `sessions` is the autopilot's own, `people` is people's sessions. The lines on where it runs (time, limit, next wake, powers) always show. [fctl session](https://app.fctl.sh/s/ses_01M7DQEXFV9KNC4CY8ZZZ2KHZH) <!-- FCTL_REVIEW_SUMMARY --> --- > [!NOTE] > **Low risk.** It adds an optional `only` filter to the autopilot brief and extends briefing text and docs; without the filter the brief is unchanged, and an older control plane ignores the parameter. > > **What it does.** Adds more lessons and a rule on which sessions count toward an autopilot's session limit (queued, starting, working, paused or still stopping) to its briefing, the limit's error and the docs. The autopilot can now read its brief in parts with `fctl autopilot brief --only sessions,asks` (and `?only=` on the API), so each wake reads less. Unknown or empty part names are refused with an error that lists the parts. > > **Partial brief and notes.** Notes and answers in parts left out by `--only` stay new, so the next whole brief or wake still marks them. > > <sub>[fctl review](https://app.fctl.sh/s/ses_01M7DTRWZ9Y28496BEBENG90M5)'s first look at [`0f6bff4`](0f6bff4) · 11 files, +357 −44 · [Review agent settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub> <!-- /FCTL_REVIEW_SUMMARY --> --------- 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.
Summary
Carl Oscar asked the spaghetti autopilot what it would tell any fctl autopilot. Its own sessions now start with the lessons the briefing didn't already cover:
The autopilot also lost a session's state from its plan once: a scripted replacement in a stale local copy failed silently. Its "plan --get" already existed (
fctl autopilot planprints the plan), but the briefing never mentioned it, and redirected output wasn't exact: tabs became spaces, and an empty plan printed "No plan yet." to stdout. Redirected, it now prints the plan exactly, or nothing, and the briefing says to start from it.fctl autopilot plan --section HEADING --file part.mdis new. It replaces one section, up to the next heading of its level, and when the plan has no such section it fails and names the sections it does have.I checked it with an autopilot in
cargo xtask dev, steered to run the commands in its own sandbox. It wrote a plan, replaced its "In flight" section (subsection included) and got the error for a missing one. Its briefing showed the new lines. Unit tests cover the section edit and the briefing.Worth confirming
--sectionfails rather than appending when the section is missing, so a typo in a heading can't add a second copy. Adding a section means writing the plan whole.Related:
fctl session
Note
Low risk. It adds prompt text to the autopilot briefing, a new
--sectionoption onfctl autopilot plan, and changes what that command prints when redirected; only autopilots use it, and the worst case is a wrongly edited plan.What it does. Adds more lessons from the spaghetti autopilot to the briefing every autopilot starts with, such as what may merge unseen, shared layouts, spikes, screenshot review and shipping habits. It also adds
fctl autopilot plan --section HEADING --file part.md, which replaces one section of the plan up to the next heading of its level and fails with the list of sections when none matches. When stdout is not a terminal,fctl autopilot plannow prints the stored plan exactly, soplan > plan.mdcan be edited and written back.Plan section parsing.
plan_sectioninfctl-domaindoes its own Markdown heading and code-fence parsing and rewrites the stored plan with a read-then-write from the CLI.fctl review's first look at
a9db3eb· 5 files, +340 −30 · Review agent settings