Skip to content

fix(control): retry a session a full or low-disk runner declines - #679

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/1823-give-me-a-detailed-prompt-that-i-can-sen
Dec 3, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/1823-give-me-a-detailed-prompt-that-i-can-sen

Conversation

@fctl-sh

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

Copy link
Copy Markdown
Contributor

Summary

Since #669, a runner that declined a session for any reason but its driver went on the session's list of runners that couldn't start it. That includes the two declines that only last a moment: "the host is at capacity" and the low-disk decline. FleetDO learns a runner's free slots and disk only from heartbeats, 15 seconds apart, so it can send a session to a runner that has just filled up. In a workspace with one runner, that session then failed at once ("Couldn't start on studio: the host is at capacity"). Before #669 it tried again after a backoff, and Wait::rules_out already treats busy and low-disk runners as ones that may take a session later.

Now schedule::passes recognises those two declines by the host's words, and FleetDO handles them as it handles a decline for the driver. The runner isn't added to the list, and the session goes back to the queue, "Retrying: …", with the same backoff. driver_declined stays set only for the driver, so a resume still goes back to its sandbox as before. The host now builds both messages from schedule::AT_CAPACITY and schedule::low_on_disk, so its wording and the check that matches it can't drift apart. Every host version already sends these strings, so the protocol doesn't change. The architecture doc's "Sessions a runner can't start" and ADR 0107 now say so.

Verified with a new domain test (passes is true for these two declines and false for the image, size, retiring and pull ones), the host's low-disk test, which now also checks passes on its refusal, FleetDO's tests in Node, and Clippy native and for wasm. Nothing reproduced the race end to end in cargo xtask dev.

Worth confirming

Refs #669

fctl session


Note

Medium risk. It changes how the control plane handles every session a runner declines, though only the declines for a full host or low disk; a wrong text match would retry sessions that should move or fail.

What it does. When a runner declines a session because it is at capacity or low on disk, the control plane now queues it again after a backoff, without counting that runner as one that couldn't start it. Before, such a decline marked the runner as tried, so a session in a workspace with one runner failed. The host's two decline texts now live in fctl_domain::schedule, and passes matches them in the control plane.

Match on decline text. The control plane recognises the decline by comparing the host's error text (AT_CAPACITY, and a min_free_disk_gb in its host.toml suffix), not by a flag in the protocol.

fctl review's first look at 0d3fb93 · 5 files, +78 −19 · Review agent settings

Since #669 every decline that isn't for the driver made the runner one
that couldn't start the session, which dispatch passes over until it
starts. But a runner declines a session for being at capacity or low on
disk when FleetDO's view of it, from heartbeats 15 s apart, lags: in a
workspace with one runner the session then failed at once, where it
used to try again after a backoff.

schedule::passes tells those declines by the host's words, which
schedule::AT_CAPACITY and schedule::low_on_disk now say for the host
too, and FleetDO retries them after a backoff, as it does a decline for
the driver, without counting the runner as tried. Hosts of every
version say these words, so the protocol doesn't change.
@kalaspuff
kalaspuff merged commit 16d72b2 into main Dec 3, 2026
14 of 16 checks passed
@kalaspuff
kalaspuff deleted the fctl/1823-give-me-a-detailed-prompt-that-i-can-sen branch December 3, 2026 19:08
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>
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