Skip to content

feat(autopilot): hand off to a fresh session when people ask - #512

Merged
kalaspuff merged 2 commits into
mainfrom
fctl/1156-there-should-be-a-way-to-force-an-autopi
Nov 11, 2026
Merged

kalaspuff merged 2 commits into
mainfrom
fctl/1156-there-should-be-a-way-to-force-an-autopi

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

People who steer an autopilot can now make it hand off to a fresh session of its own whenever they choose, not only after 12 hours or past its context size. After a release, say, the fresh session starts from what fctl and its briefing say now. They do it with Hand off to a fresh session in the Autopilot tab's ⋯ menu, fctl autopilot wake --fresh, or {"fresh": true} on POST …/autopilot/wake (a new wake reason, fresh). Between its turns, the fresh session takes over at once and the old one stops. While its session works, the wake waits for that turn to end, which wakes it again at once (also on a stop or a usage-limit pause), and whatever woke it meanwhile goes to the fresh session rather than to the one leaving. Until then the tab and fctl autopilot say "A fresh session takes over once this turn ends" (Autopilot.fresh_asked).

The fresh session's first message says why it takes over ("You take over from your last session, playground#1: people asked for a fresh session to take over, so fctl stopped it and started you, with what fctl and this briefing say now…"). Its log records who asked and the wake ("Dev Owner asked for a fresh session to take over", "Woke as someone asked for a fresh session"). The wake card in its session now reads "A fresh session takes over: it reads its brief, then goes on from its plan and log." for any handoff, where it said "It was put on autopilot". The autopilot can't ask for one itself, and --fresh fails against a control plane too old to know it rather than claim a handoff that didn't happen.

Verified with unit tests (Rust and web), Clippy, the web app's Biome and TypeScript check, and in cargo xtask dev with fake-claude. Between turns, fctl autopilot wake -p playground --fresh printed "A fresh session takes over now": playground#3 took over and #1 stopped. Mid-turn, with #3 kept busy for 40 s by a note, it printed "A fresh session takes over from playground#3 once its turn ends", fctl autopilot showed ● At work in playground#3 · a fresh session takes over once this turn ends, and #6 took over within 3 s of the turn's end while #3 stopped.

The design docs describe it in hyperstructure/design:

Screenshots

The tab's ⋯ menu, light, dark and on a phone:

after-menu-light.png
after-menu-dark.png
after-menu-390.png

The tab while a fresh session waits for its session's turn to end:

after-pending-light.png

The wake card a fresh session that takes over opens with, before and after (light, then dark):

before-card-light.png
after-card-light.png
after-card-dark.png

Worth confirming

  • Decision: A session at work finishes its turn before the fresh one takes over, as automatic handoffs do: nothing stops it mid-turn. What wakes it meanwhile is held for the fresh session rather than told to the one leaving.
  • Decision: Between turns, the old session gets no last turn to write notes: as with the 12-hour and context-size handoffs, the fresh one starts from the plan and log the briefing asks it to keep current.
  • Decision: Only those who steer it (a project's maintainers and owners, a workspace's admins) can ask, with no confirmation dialog, and asking doesn't move it onto their subscription, as Wake now doesn't. The autopilot can't rotate itself.
  • Decision: Pausing it drops a handoff still waiting for the turn to end (a pause clears pending wakes and stops its session); people ask again after resuming.

fctl session


Note

Medium risk. It changes when and how an autopilot's session is replaced, across the control plane, CLI and web, but it only acts when people ask for a fresh session.

What it does. Adds a way for people to make an autopilot hand off to a fresh session: fctl autopilot wake --fresh and a menu item in the web app. A fresh session asked for while the current one works takes over once its turn ends, or at once if the session stops or pauses. The API reports this as fresh_asked, and the web tab and CLI say so.

Version skew. The new fresh wake reason and fresh_asked field are optional for older clients, and fctl autopilot wake --fresh fails with a clear message against a control plane that predates it.

fctl review's first look at 9ef137e · 20 files, +424 −65 · Review agent settings

People who steer an autopilot can now start a fresh session of its own
that takes over from the one it works in (fctl autopilot wake --fresh,
Hand off to a fresh session in its tab's menu, {"fresh": true} on the
wake endpoint): at once between its turns, else once its turn ends, with
all it woke for meanwhile. The fresh session hears why it takes over.
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-control/src/autopilots.rs Resolved
Comment thread crates/fctl/src/cmd/autopilot.rs Resolved
… and check --fresh landed

A fresh session people asked for while its own worked now also takes over
when that one pauses on a usage limit; the tab says a fresh session takes
over whatever else wakes it with it; and fctl autopilot wake --fresh
fails against a control plane that ignored it.
@fctl-sh

fctl-sh Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

On the review's second finding (the resting line ignores fresh_asked): fixed in 9ef137e. wakeWords now reads fresh_asked before wake_reason, so while a fresh session is due between turns the tab says "A fresh session takes over now." even when a crew or woken wake is pending with it. A test covers it.

@kalaspuff
kalaspuff merged commit 0be8329 into main Nov 11, 2026
14 checks passed
@kalaspuff
kalaspuff deleted the fctl/1156-there-should-be-a-way-to-force-an-autopi branch November 11, 2026 16:01
kalaspuff pushed a commit to hyperstructure/design that referenced this pull request Nov 11, 2026
## Summary

Describes how people hand an autopilot off to a fresh session of its own
when they choose, as hyperstructure/fctl#512 adds it. That means *Hand
off to a fresh session* in the Autopilot tab's ⋯ menu, and the tab's
sentence while the handoff waits for the turn to end ("A fresh session
takes over once this turn ends") or happens now. It also covers the
toasts, the log lines, and the wake card that a fresh session taking
over now opens with ("A fresh session takes over: it reads its brief,
then goes on from its plan and log.").

Docs only; the screenshots are in the fctl pull request.

- hyperstructure/fctl#512

[fctl session](https://app.fctl.sh/s/ses_01M75HXM637MQ7M8VKPDAJ7ENE)

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!NOTE]
> **Low risk.** It only changes the design docs for the autopilot page;
no code or tokens change.
>
> **What it does.** Documents the new way to hand an autopilot off to a
fresh session on request, as hyperstructure/fctl#512 adds it. It covers
the ⋯ menu item, the header sentences while the handoff waits for the
turn to end or happens now, the toasts, the log lines, and the wake card
a taking-over session opens with.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M75MGE33PVVHRAW4Y8HSRRY4)'s first
look at
[`be4aa15`](be4aa15)
· 1 file, +13 −4 · [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>
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.

1 participant