Repository navigation
feat: install fctl in sandboxes and let agents name their sessions - #33
Merged
Merged
Conversation
Sessions are titled with the first line of their task, so the session
list shows prompts rather than work. Agents now report a title and a
description for their own session:
- fctl-agent serves a session socket beside the host's
(agent.session.sock, FCTL_SESSION_SOCKET for Claude). A program in
the sandbox sends one edit request; the agent validates it and keeps
the title and description in the session state it reports, which the
host passes on and re-sends after every reconnect. No credentials
for the control plane enter the sandbox.
- SessionDO applies an agent's title or description only when it
differs from the agent's previous report, so a person's rename
stands until the agent renames the session again. It validates both
again and writes them through to D1.
- Sessions gain a description (migration 0004), which owners can also
set or clear with PATCH /sessions/{id}.
- At Claude's start, fctl-agent writes ~/AGENTS.md with how to keep the
title and description current, and imports it from Claude's user
memory (~/.claude/CLAUDE.md), which loads in every repository without
displacing the repository's own CLAUDE.md or AGENTS.md. It does so
only when the sandbox's fctl can edit the session.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`fctl edit [SESSION] --title … --description …` renames a session or says what it is about. In the sandbox of the session it edits it asks fctl-agent over the session socket and needs no sign-in, which is how agents name their own session; anywhere else it goes through the API. `fctl show` prints the description. The default image installs fctl in /usr/local/bin with fctl.sh's installer, at the host's version (`fctl host image build` passes it as FCTL_VERSION; an unpublished version falls back to the latest release). Process-driver agents get the host's own fctl first on their PATH, so `cargo xtask dev` sessions can rename themselves too, and fake-claude does with `rename <title>`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The session page's header shows the session's description, one line with the full text on hover, below the title the agent keeps current. Lists already update live from the session summaries the dashboard feed sends, so agent renames appear there as they happen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`fctl host image build` passes download_base as FCTL_DOWNLOAD next to FCTL_VERSION, so hosts that mirror releases elsewhere get the image's fctl from the mirror too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The architecture, security, CLI, development, getting-started and self-hosting docs describe the session socket, `fctl edit`, the sandbox's ~/AGENTS.md and rebuilding the image after an upgrade. ADR 0007 records why agents go through fctl-agent rather than holding a token, why the title travels as session state, and why the instructions are imported from Claude's user memory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`cargo xtask dev` posted the fake-claude token to /me/claude, which has
no POST route, so a fresh dev stack stopped while bootstrapping
("adding a Claude credential: HTTP 404"). The route is
/me/claude/token, as fctl-client uses.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The control plane wants a setup token of at least 40 characters; the dev bootstrap's fake one had 33, so it was refused once it reached the right route. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l-installed-in-the-image-w # Conflicts: # crates/fctl-agent/src/prompt.rs # crates/fctl-agent/src/supervisor.rs
fctl-sh Bot
added a commit
that referenced
this pull request
Oct 18, 2026
Conflicts with sandbox limits (#31), fctl in sandboxes and agent-named sessions (#33) and claude.ai connectors (#32): - The system prompt takes the repositories' paths and the sandbox's size; AGENTS.md and the size line from main stay as they are. - The supervisor keeps both new fields and functions; the spec keeps `grants` and `session_wants` and passes main's adjusted settings. - ADR 0007 is main's (agents name their sessions); the repositories ADR becomes 0008. - The project page keeps main's start button and sandbox hint next to the Repositories tab. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 18, 2026
kalaspuff
pushed a commit
that referenced
this pull request
Oct 18, 2026
On a machine without `worker-build`, `cargo xtask dev` built everything and then failed when wrangler started the control plane: `crates/fctl-control/wrangler.toml` builds the Worker with `worker-build --dev`, and only `cargo xtask deploy` installed it (CI installs it in a step of its own). xtask then kept waiting for the health check, which gives up after five minutes. `cargo xtask dev` now calls `util::worker_build()`, as `deploy` does. It installs worker-build 0.8.7, the version of the `worker` crate in `Cargo.lock`, with `cargo install` when it isn't on the PATH. The call comes first, right after `npm ci`, so a machine that can't build worker-build finds out in seconds, not after the other builds. `docs/development.md` lists worker-build in the setup, with what its build needs on Debian and Ubuntu: `pkg-config` and `libssl-dev`, because on Linux its HTTP client links OpenSSL. I found this while checking #34 on a fresh clone. #33 had already fixed the Claude credential bootstrap that #34 reports, but `cargo xtask dev` never got far enough to run it. ## How I verified it From a fresh clone (no `.fctl-dev/`, `crates/fctl-control/.wrangler/`, `node_modules` or `web/dist`), in a sandbox with Rust but no worker-build: - **Before, on `main`:** `[custom build] /bin/sh: 1: worker-build: not found`, then `Running custom build 'worker-build --dev' failed`, while xtask went on waiting for the health check. - **Without OpenSSL's headers:** it stops after 25 s, before the other builds, with openssl-sys's "The system library `openssl` required by crate `openssl-sys` was not found". - **With them:** it installs worker-build, builds and bootstraps. `POST /api/v1/setup`, `/auth/tokens`, `/me/claude/token`, `/projects` and `/runners` all return 201, and it reaches "fctl dev is running" in 79 s. Vite serves the app at http://localhost:5173 (`npm ci` fetched the design package). Two fake-claude sessions ran to the end: `write notes.md` committed a file, and `rename Check the dev bootstrap` renamed its session with `fctl edit`. - A restart on that state reaches "fctl dev is running" in 6 s and adds nothing. With `.fctl-dev/token` deleted, it signs in with the password and makes a new token. - `cargo xtask check` passes. ## Not changed - When `wrangler dev` exits before it is healthy (any failing first build, a compile error included), `cargo xtask dev` still waits the full five minutes, because `wait_for` doesn't watch the wrangler process. - #34 left a question for a person: whether CI should run the bootstrap. It is now #53, with this as a second break CI didn't catch. - #41's question, whether the default sandbox image should include Rust and `libssl-dev`, was answered by #45, which added both along with `pkg-config`. Fixes #41 Refs #34 Session: https://app.fctl.sh/s/ses_01M56GFH2FJV0NW90ZNRFWKEA3 Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Session lists showed each session's first prompt, cut off ("Work on issue https://github.com/…", "Can you implement …"), because a session's title is the first line of its task. Now the agent names the session after the work, describes it in a sentence or two, and renames it when the work turns to something else.
In the sandbox
/usr/local/binwith fctl.sh's installer.fctl host image buildpasses its own version (FCTL_VERSION) anddownload_base(FCTL_DOWNLOAD). A version that isn't published falls back to the latest release.fctl edit [SESSION] --title … --description …. In a sandbox with no session given, it talks to fctl-agent over a new session socket beside the host's (agent.session.sock,FCTL_SESSION_SOCKET). The agent needs no fctl credentials and can only reach its own session. Anywhere else the command goes throughPATCH /sessions/{id}, so people can rename and describe sessions too.fctl showprints the description.~/AGENTS.md(beside the checkout in~/workspace) saying when and how to name the session, and imports it from Claude's user memory (~/.claude/CLAUDE.md). Not a file above the checkout: Claude Code's defaultinstructionFilesmode skips anAGENTS.mdthere whenever the repository has aCLAUDE.md, and aCLAUDE.mdthere would switch off an AGENTS.md-only repository's own instructions. I checked with Claude Code 2.1.302's/contextthat the import loads~/AGENTS.mdonce in all four cases: a repo with aCLAUDE.md, a repo with only anAGENTS.md(which still loads), a repo with neither, and--setting-sources user. fctl-agent writes the file only when the sandbox'sfctl edit --helpworks. Otherwise it logs once that the session keeps its first title.Control plane
SessionState.titleand.description), which the host already re-sends after reconnects. A new event kind would have broken older CLIs, which reject event kinds they don't know. The agent'sfctl editcall shows in the transcript anyway.description(migration 0004).PATCH /sessions/{id}sets it or clears it with"", and account exports include it. Titles now reject control characters, since terminals print them.Web: the session page shows the description under the title. Lists already update from the feed's session summaries, so renames show up there live.
Also
rename <title>.cargo xtask devcouldn't bootstrap a fresh checkout, so I fixed that too. It posted the fake Claude credential to/me/claude(the route is/me/claude/token) with a 33-character token (the API wants at least 40).Compatibility: the protocol changes are optional fields and a new socket. Older hosts and agents keep working, and their sessions keep their first title. Migration 0004 runs before the Worker deploys, as usual. Agents name sessions once hosts run a release with this change and have rebuilt their image (
fctl host image build). Process-driver hosts need no rebuild.How I verified it
cargo xtask check --quickpasses: format, generated types, Biome and TypeScript, Clippy native and wasm,cargo test, Vitest. The web checks ran against a stub of@hyperstructure/design, which this sandbox can't fetch.cargo xtask devand fake-claude.fctl run -p playground "rename Fix the flaky login test"started a session whose transcript shows the agent'sfctl editcall;fctl showandfctl sessions(from D1) then had the new title and description. The sandbox's~/.claude/CLAUDE.mdimports~/AGENTS.md. On a second session:fctlstays in the install directory.Not verified, or needing a person
container build --build-argon a Mac. Apple's command reference lists--build-arg.legal/privacy.mdmay need a line if it lists what a session stores, since sessions now keep a description written by the agent or the owner. This session's token can't reach that repository.Refs #28:
~/AGENTS.mdis where fctl-wide instructions for every project's agents could go, if that's decided.Session: https://app.fctl.sh/s/ses_01M565EJZSBP0VB1A7YG98K718