Skip to content

fix(web): stop offering to move review sessions off a quiet runner - #680

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/1823-review-sessions-move-off
Dec 3, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/1823-review-sessions-move-off

Conversation

@fctl-sh

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

Copy link
Copy Markdown
Contributor

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.

Refs #678

fctl session


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.

fctl review's first look at f77e613 · 3 files, +21 −2 · Review agent settings

The stall notice offered "Move to another runner" to whoever manages the
session, review agents' sessions included, which the ⋯ menu leaves out
and POST /sessions/{id}/move refuses: the click failed with a toast
about review agents taking no messages. TurnTranscript now takes
canMove, which the session page gives its owner unless it is a review.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner December 3, 2026 18:05
kalaspuff pushed a commit that referenced this pull request Dec 3, 2026
## 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

- **Decision:** a full or low-disk decline still counts towards the
session's five attempts, as before #669. If FleetDO kept sending the
session to runners that declined it for room, it would fail after about
75 seconds of backoff. Normally the next heartbeat shows the runner busy
first, and the session then waits without using attempts.

- #680

Refs #669

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

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!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.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M8YH5TQRYCKJ3FRZXT0E9K59)'s first
look at
[`0d3fb93`](0d3fb93)
· 5 files, +78 −19 · [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
kalaspuff merged commit e985597 into main Dec 3, 2026
13 checks passed
@kalaspuff
kalaspuff deleted the fctl/1823-review-sessions-move-off branch December 3, 2026 19:08
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