Skip to content

feat: move sessions off runners that went quiet, at once or when asked - #678

Merged
kalaspuff merged 8 commits into
mainfrom
fctl/1817-if-the-sandbox-for-an-autopilot-cannot-b
Dec 3, 2026
Merged

kalaspuff merged 8 commits into
mainfrom
fctl/1817-if-the-sandbox-for-an-autopilot-cannot-b

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A runner on a laptop that went to sleep kept its control connection open, so fctl counted it online for as long as anyone watched: the runners list said "online" 11 minutes after its last heartbeat. Everything on it waited. A wake or follow-up to an autopilot whose own session was there sat in that session's outbox, Stop left it "Stopping", and Hand off to a fresh session waited for a turn that couldn't end. This makes fctl stop waiting for such a runner, and lets people move a session off it themselves (ADR 0108):

  • A runner silent for a minute is offline. FleetDO counts four missed 15-second heartbeats as offline, closes the connection, and reconciles the host's sessions when it says hello again. A stop then doesn't wait for that runner either.
  • An autopilot carries on elsewhere. Once its own session's runner has been offline a minute, and another runner would run it, the next wake starts a fresh session on another runner, even mid-turn. These wake it again with the new wake reason away: a wake that reached the old session first, a person's message to it, and a turn the ten minutes cut off. A hand-off people ask for doesn't wait for the turn to end. The autopilot's view says when its session's runner was last heard from (AutopilotSession.runner, runner_away_since). The Autopilot tab and fctl autopilot show Runner away, and the hand-off's copy in the CLI and the toast says what happens. Where no other runner online would run it, the wake waits for this one, and the copy says a fresh session takes over "where one online would run it".
  • Move to another runner (fctl move, POST /api/v1/sessions/{id}/move, the session's ⋯, the stall notice, and the Autopilot tab's ⋯ for its own session). This is for a laptop that wakes for a moment now and then: it is online for those moments, which keeps its sessions from stopping, but gets no further with them. The session leaves that runner, which doesn't get it back until it has started elsewhere. A runner online is asked to stop it first, for a minute at most, so its agent saves a snapshot; one offline is let go at once. A second Stop a minute after a first that wasn't carried out lets go of the runner too, rather than staying "Stopping".

I verified it in cargo xtask dev with a second host frozen with SIGSTOP as the laptop. The runner shows offline within a minute and a stop is immediate. A wake that landed in the stranded autopilot session moved the autopilot to a fresh session on the other runner, and so did a hand-off mid-turn. fctl move and the notice's button moved a running session to the other runner. When the frozen host woke, it stopped its old run, its uplink and snapshot upload were refused, and the moved session carried on undisturbed. The domain, CLI, proto and web tests and the control plane's 90 tests in Node pass, and Clippy (native and wasm) is clean.

Screenshots

A session on a runner that went quiet: before, the notice says to wait; after, its owner can move it, and is told what that keeps.

before-session-dark-1440.png
after-session-dark-1440.png

The autopilot's own session there (a fresh one, #15, in the after shot): before, nothing says what happens; after, the notice says the autopilot doesn't wait, and its card says Runner away.

before-pilot-dark-1440.png
after-pilot-dark-1440.png

The Autopilot tab, light theme: before it said "Waiting for you" as if all were well; after, Runner away and what follows.

before-autopilot-light-1440.png
after-autopilot-light-1440.png

The session's ⋯ with the new item, the notice at a phone's width, and the session a moment after Move to another runner, carrying on on dev-host.

after-menu-dark-1440.png
after-session-dark-390.png
after-moved-dark-1440.png

The design docs change with it:

Worth confirming

  • Decision: a runner silent for one minute counts as offline. A host stalled that long (a frozen process, a network that drops everything) is offline for that while, and an autopilot woken meanwhile moves on, stopping the session it left once the host is back.
  • Decision: an autopilot's own session moves mid-turn once its runner has been away a minute. What that turn was doing is cut off; the fresh session starts from the plan, log and files.
  • Decision: other sessions still get ten minutes before they stop, as their conversation lives in that sandbox. Messages sent to them meanwhile now resume them elsewhere at once when the ten minutes are up.
  • Decision: Move to another runner has no confirmation dialog. With no snapshot of its last run, the session starts again from its branch with a new conversation, and what it hadn't pushed stays on the old runner; the notice says so under the button.
  • Decision: a reachable runner gets one minute to stop a moved session, so it can save a snapshot, before fctl lets go of it.
  • Assumption: only the session's owner moves it (as with stop and resume). People who steer an autopilot without owning its session see the Autopilot tab's item but get "Only the session's owner can do this".
  • Decision: FleetDO's alarm now ticks every 30 seconds while any session runs, not only while one waits or a runner is offline, so that a runner going silent alone is noticed.

fctl session


Note

Medium risk. It changes when fctl treats a runner as offline and when sessions and autopilots move off it, which affects every running session, though only for runners that go quiet.

What it does. A runner silent for a minute now counts as offline, so stops don't wait for it and an autopilot whose own session sits there carries on in a fresh session on another runner. People can also move a session to another runner themselves (fctl move, POST /api/v1/sessions/{id}/move, the session menu and the stall notice). Since the last review, a session moved off a runner that then went offline has its old runner cleared when its assignment expires, and the 'Runner away' wording says a fresh session takes over only where another runner online would run it.

Offline threshold and alarm. A runner silent for one minute is offline, and FleetDO's alarm now ticks every 30 seconds while any session runs, so a stalled host can lose its sessions sooner than before.

fctl review's first look at 74742f7 · 37 files, +1530 −199 · Review agent settings

fctl-sh Bot added 6 commits December 3, 2026 14:46
FleetDO tells a session once its runner has been offline a minute; an
autopilot's own session with a wake or message waiting wakes its
autopilot, which carries on elsewhere. A hand-off doesn't wait for a turn
on a runner that went away. The autopilot's view says when its session's
runner was last heard from, and the CLI, the Autopilot tab and the
session page say what follows. ADR 0108.
fctl move, POST /sessions/{id}/move, and Move to another runner on the
session page, its stall notice and the Autopilot tab. FleetDO keeps the
session off that runner until it starts elsewhere; a runner online stops
it first, for a minute at most, and one offline is let go at once. A
second stop a minute after the first, which its runner didn't carry out,
lets go of the runner too.
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-control/src/do_session.rs Resolved
…out a page open

SessionDO marks a quiet uplink before it reads whether the runner went
away, as a viewer's ping would. The CLI's status line, the --fresh help
and the docs say a hand-off doesn't wait for a turn on a runner that went
away.
@fctl-sh

fctl-sh Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

On the review's second finding (autopilot status still saying a fresh session waits for the turn): fixed in bdc3151. While its session's runner is away, fctl autopilot now says "Runner away · playground#14 is on runner laptop, last heard from 3m ago: a fresh session takes over on another runner now" (or "as something next wakes it" when none was asked for), as the web app does. The --fresh help, docs/api.md, docs/cli.md and the proto's doc comments (and so web/src/gen) say it doesn't wait for a turn on a runner that went away.

@fctl-review

This comment has been minimized.

Comment thread crates/fctl-control/src/do_fleet.rs Resolved
Comment thread crates/fctl/src/cmd/autopilot.rs Resolved
…pires

A session queued again while its run stopped on a runner that stayed
offline has its runner cleared, so that runner doesn't take it back as it
reconnects. The runner-away copy holds where no other runner online would
run the session: the wake waits for one then.
@kalaspuff
kalaspuff merged commit b51b0e9 into main Dec 3, 2026
14 checks passed
@kalaspuff
kalaspuff deleted the fctl/1817-if-the-sandbox-for-an-autopilot-cannot-b branch December 3, 2026 17:11
kalaspuff pushed a commit that referenced this pull request Dec 3, 2026
)

## Summary

Since #678, the notice the session page shows when a runner's work isn't
coming through offers *Move to another runner* to the session's owner,
review agents' sessions included. The ⋯ menu leaves the item out for
reviews, and `POST /sessions/{id}/move` refuses them. So the click
failed with an unrelated toast ("Review agents take no messages…"). The
transcript now takes its own `canMove`, which the session page sets for
the owner unless the session is a review. `canManage` still governs
everything else it did.

Verified with a new transcript test: the move appears with `canMove` and
not without it, for a reader who still manages the session. The test
fails without the fix. `npm run check` and the web app's whole test
suite pass. There is no screenshot: the only visible change is that the
button no longer appears on a review session's stall notice, and other
sessions' notices look as before.

- #679

Refs #678

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

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!NOTE]
> **Low risk.** A small web-only change that hides one button for review
agent sessions; nothing else reads the new prop.
>
> **What it does.** Review agent sessions can't be moved to another
runner, but the stall notice still offered "Move to another runner" to
their owner. This adds a `canMove` prop to `TurnTranscript`, set in the
session page to `isOwner && !session.review`, and uses it instead of
`canManage` for the move button. A test covers both cases.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M8YHB0382Q8YGTJQMAXX4PMY)'s first
look at
[`f77e613`](f77e613)
· 3 files, +21 −2 · [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>
kalaspuff pushed a commit to hyperstructure/design that referenced this pull request Dec 3, 2026
## Summary

The web app's docs for what fctl's change to sessions on a runner that
went quiet shows: the stall notice's *Move to another runner* button and
what it says under it, the autopilot's own session's stall copy, the
session's ⋯ item, the Autopilot tab's **Runner away** phase and its
*Move its session to another runner* item, and a hand-off that doesn't
wait for a turn on a runner that went away.

- hyperstructure/fctl#678

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

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!NOTE]
> **Low risk.** Documentation only, in two web-app spec files.
>
> **What it does.** Documents what happens when a session's runner goes
quiet: the transcript's runner-away notice, a new `Move to another
runner` button under any stall and in the session's ⋯ menu, and how an
autopilot's session is replaced on another runner. It also adds the
matching 'Runner away' status row and menu item to the autopilot page,
with the wording for when no other runner is online.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M8YAA92QE3CXFHYZ2BZ2FXCX)'s first
look at
[`c521374`](c521374)
· 2 files, +15 −3 · [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