Skip to content

fix(host): check the driver before registering a runner - #24

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/1-host-install-checks-the-driver
Oct 17, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/1-host-install-checks-the-driver

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What happened

On the hyperstructure Mac (#1), without Apple's container installed:

$ fctl host install --driver apple --build-image
✓ Registered runner substrate (rnr_01M563CGZTJH1ZF245AW5K105G)
✓ Wrote /Users/…/.config/fctl/host.toml
✓ Driver: apple (`container` is not installed or its service is stopped (run `container system start`))
$ container build --tag fctl-agent:latest …
error: running container: No such file or directory (os error 2)
$ container system start
-bash: container: command not found

--driver lima did the same with limactl. The Mac now has two runners named substrate, and only the second one's token is on disk.

What changes

  • Install checks before it registers. fctl host install checks sign-in, picks the driver, builds the image if asked, and requires a ready driver, all before it registers a runner. A failure leaves nothing registered and nothing written:
    error: The apple driver is not ready: Apple's `container` is not installed (get it from https://github.com/apple/container/releases, then run `container system start`). Nothing was registered; run this again once it is.
    
  • --driver auto never settles for the process driver. That's the default, and it used to fall back to the process driver (no isolation) when no runtime was ready. Now it lists what each runtime lacks and asks for --driver process explicitly.
  • The checked driver is saved. host.toml gets the driver install checked instead of auto. The service picked again at every start, so a host that started before its runtime was up could quietly run agents with the process driver. Hosts installed earlier keep auto until they're reinstalled or the file is edited.
  • Clearer messages.
    • The Apple and Docker checks say whether the runtime isn't installed or isn't running, each with its fix, and Lima's says where to get Lima.
    • A program that isn't on the PATH is named ("limactl is not installed") instead of "No such file or directory".
    • fctl host image build checks the runtime first too.
  • Docs. docs/cli.md describes the check and shows a concrete driver in host.toml.

How I verified it

  • New tests: driver::container::tests::says_whether_the_runtime_is_missing_or_stopped, with true, false and a missing program standing in for the CLIs, and driver::tests::a_missing_program_is_named.
  • Install scenarios. I ran fctl host install in throwaway config directories with --token and --no-service, so nothing reached a server or launchd. FCTL_CONTAINER_BIN and FCTL_DOCKER_BIN provided stand-ins.
    • These fail with the messages above and write nothing: Apple's CLI missing (with and without --build-image), Apple's service stopped, Lima missing with --build-image, auto with nothing ready, not signed in, and fctl host image build with Apple missing.
    • These succeed: --driver process, Apple ready, and auto with Docker ready. They save process, apple and docker.
  • Checks: cargo fmt --all --check, clippy (native and wasm) with -D warnings, and cargo test --workspace --locked (67 tests) pass.
  • Not verified: Apple's real container CLI and launchd on macOS.

Is it breaking?

On a machine with no runtime, fctl host install now needs --driver process explicitly, where it used to fall back to it. I didn't mark it breaking (!): the fallback wasn't documented, and it ran agents without isolation. cargo xtask dev writes driver = "process" itself and isn't affected. Add the ! if you see it differently.

Not changed

  • The daemon still falls back to the process driver, with a warning, when driver = "auto" and nothing is ready. Changing that affects hosts that rely on it, so it's worth deciding separately.
  • fctl admin runners doesn't show ids, and the CLI can't delete runners (the web app can). The two "substrate" runners have to be cleaned up in Admin → Runners.

This ships with the next release. Until then, on the Mac: install Apple's container, run container system start, then run FCTL_RUNNER_TOKEN="$(cat ~/.config/fctl/host-token)" fctl host install --driver apple --build-image, and delete the first "substrate" runner.

Refs #1

Session: https://app.fctl.sh/s/ses_01M560YQN20DK06NSEWWVYB3Q4

🤖 Generated with Claude Code

On the hyperstructure Mac, `fctl host install --driver apple
--build-image` without Apple's `container` installed registered a
runner, wrote the config, printed "✓ Driver: apple" with a detail saying
it was not usable, then failed the image build with "running container:
No such file or directory". Its hint, `container system start`, cannot
work without the CLI. `--driver lima` did the same with limactl, so the
Mac now has two runners named substrate.

- Install checks sign-in, picks the driver, builds the image if asked
  (checking the runtime first) and requires a ready driver before it
  registers anything, so a failure leaves nothing behind.
- `--driver auto` no longer settles for the process driver, which has no
  isolation, when no runtime is ready; it lists what each one lacks.
- The driver it checked goes into host.toml instead of `auto`, so the
  service does not pick again at start, possibly before a runtime is up.
- The Apple and Docker probes tell "not installed" from "not running",
  with the fix for each, and Lima's says where to get it. A program that
  is not on the PATH is named as such.

Refs #1

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fctl-sh fctl-sh Bot changed the title Check the driver before fctl host install registers a runner fix(host): check the driver before registering a runner Oct 17, 2026
@kalaspuff
kalaspuff merged commit 2b839fb into main Oct 17, 2026
7 of 8 checks passed
@kalaspuff
kalaspuff deleted the fctl/1-host-install-checks-the-driver branch October 17, 2026 23:56
kalaspuff pushed a commit that referenced this pull request Oct 18, 2026
Agents now have written rules for issues and for what to do after
opening a pull request. The rules go in AGENTS.md, which any agent
reads, and the step-by-step procedures go in two new Claude Code skills
next to `commit` and `release`. Skills load only when needed.

- **`.claude/skills/issues/SKILL.md`** covers:
- reading an issue, its comments and the pull requests that mention it
before starting (`gh api …/issues/N/timeline`, so you see only real
cross-references);
- `Fixes #N` only for a pull request that does everything the issue
asks, `Refs #N` otherwise;
- ticking checklist items only once they're done and verified, with
evidence, and posting status comments for partial progress;
- when an issue may close, with leftovers moved to new linked issues,
and asking before closing an issue the task didn't name;
- new issues: search for duplicates, the shape of #12 and #13, the
component labels, and the fctl session link but no tool footers;
  - adding to other people's issues instead of rewriting them;
  - what to do when another repository needs a change.
- **`.claude/skills/pull-requests/SKILL.md`** covers:
- waiting for CI in the same turn with `gh pr checks N --watch
--fail-fast`, since nothing wakes a session afterwards until #8;
- reading failures with `gh run view --log-failed`, fixing title
failures with `gh pr edit --title`, and rerunning infrastructure
failures once;
  - answering each review comment in its thread;
  - rebasing your own branch when `main` moves;
- after the merge: not pushing to the merged branch, recording the merge
in the issue, and saying whether the change is deployed, released or
waiting for a release (`git tag --contains`).
- **AGENTS.md** gets "Issues" and "After opening a pull request"
sections with the rules, linking the skills.
- **The `commit` skill** now says `Fixes` only when the pull request
finishes the issue and `Refs` otherwise, and points to `pull-requests`
after opening one.

The same rules go to hyperstructure/design and hyperstructure/fctl-site
in their own pull requests, adapted to their checks and labels. Those
repositories now have component labels like fctl's.

#20's "decision for later" (whether fctl's prompt gives every project
these rules) is now #28, together with #20's two checks that need real
sessions.

## How I verified it

Claude Code 2.1.296's `system/init` event, started in this branch, lists
`commit`, `release`, `issues` and `pull-requests` under `skills`. That's
#20's first check. I also checked the `gh` commands against the API, for
example the timeline query on #1, which lists #14, #15, #20 and #24.

Fixes #20

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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