Skip to content

Crew: automatic setup, open workspaces, deletion, agents that work on the server, @agent, a Crew tasks model and cluster-aware context - #406

Merged
Broccolito merged 36 commits into
mainfrom
claude/crew-auto-setup
Oct 18, 2026
Merged

Broccolito merged 36 commits into
mainfrom
claude/crew-auto-setup

Conversation

@Broccolito

Copy link
Copy Markdown
Collaborator

What this does

Crew on a shared Linux server, set up and used with nothing but your server login. The design contract is
docs/crew/design/open-workspaces-and-automatic-setup.md
(OW-1 to OW-12); the manual in docs/crew/ is updated to match and scripts/check-crew-manual.mjs passes.

  • Automatic setup (OW-9). Every desktop and CLI build carries the Linux broker with a manifest. One setup
    service in the daemon, shared by the GUI and biorouter crew setup | host | doctor, probes the server,
    sends the broker over SSH, checks its SHA-256, installs it atomically (keeping .previous), signs in
    through the Sign in window when the server asks for a password or code, starts or joins the workspace,
    makes the work folder and drafts the workspace context. A host whose ~/.local is writable by others is
    told which folders and how to fix it, or --fix-permissions does it.
  • Open workspaces (OW-1 to OW-3). A new workspace is open: every member can create, rename and delete
    teams and channels and add people, and joiners are added to every team and channel. The host can switch
    to managed. #general is deleted only with its team.
  • Agents that can work on the server (OW-6, OW-7). A connection's agent access is off, a confined
    folder (needs Landlock ABI 3, so not on Ubuntu 22.04's 5.15 kernel), or "as me on the server": commands
    run in the member's own account through their own bridge, with their login shell, network and tools,
    detached jobs, and remote.fetch_blob / remote.share_file to move channel files to and from the
    server. Members get it by default, so nobody who does not own a channel is blocked.
  • Deletion (OW-4, OW-5). Channels, teams and the workspace can be deleted from the GUI (daemon routes)
    and the CLI. A deleted workspace erases only the files its broker created; members are told, connected,
    idle or offline (a tombstone in the broker's runtime directory), and can only remove it.
  • Invoking agents (OW-10). @agent, /agent and /task in the Crew composer start a task in the
    channel, and biorouter crew ask does the same from a terminal.
  • Default model for Crew tasks (OW-11). Settings > Models > Crew tasks, and biorouter crew defaults.
  • Cluster-aware agents (OW-8, OW-12). At creation the daemon renders a workspace context from
    biorouter-crew probe (machine, scheduler or none, modules, conda, containers, languages, storage); any
    member can edit it, and every member's agent reads it before running work.

How it was tested

  • Unit and contract tests: cargo test -p biorouter-crew (with and without default features, including
    the Linux-only delete and full-access contracts in a Linux container), -p biorouter --lib crew::,
    -p biorouter-server --lib crew, -p biorouter-cli --lib, vitest for src/components/crew,
    lint:check, format:check, clippy-lint.sh (no new too_many_lines entries), the retired-name guard
    and the manual checker with its mutant suite.
  • Live, on leo.ucsf.edu with two real accounts (one key, one password through an askpass script), in
    both directions and in two desktop windows: host, join, auto-join, member-managed channels and teams,
    messages, upload/list/download, each member's agent fetching the other's file, computing on the server
    and sharing a result back, conda, network, a detached job read by a follow-up task, context edits by a
    member, governance both ways, Browse channels, the Crew tasks model reaching the composer, and deleting
    channels, teams and workspaces with connected, idle and offline members.

Known limits and follow-ups

  • The website pages describe the released 1.93.0 and are not changed here; update them at release.
  • A member's "deleted" mark is daemon memory; after a restart it is learned again from the tombstone, which
    lasts as long as the broker's runtime directory under /tmp.
  • crew join on a connection that never connected gives it setup's default access (full, announced),
    even if the person chose Off before it ever connected; no saved field tells the two apart.
  • Some test functions are over 100 lines; the too_many_lines gate does not count tests.

🤖 Generated with Claude Code

run.create accepts remote_access "full" only with a remote root, remote
execution and a private provider, stores it on the run (serialized only
when full, so older journals replay byte for byte) and echoes it.
run.remote_scope adds access, owner_id and channel_id, and the broker
advertises remote_access_v1 after presence_v1.
…or (OW-6, OW-7)

The bridge answers bridge.hello and bridge.probe itself and never forwards
a bridge.* frame. A scope with access "full" goes to the new remote_full
module: remote.shell and remote.execute run as the member through the
login shell under a __crew-run supervisor (owner-keyed job records in
~/.local/state/biorouter-crew/jobs, detach, timeout, cancel by process
group), file operations take absolute, ~/ or work-folder paths, and
remote.fetch_blob and remote.share_file move attachments on a second
broker connection in the background. Folder mode is unchanged except that
a kernel below Landlock ABI 3 is refused up front. New verbs: probe,
doctor and --version --output-format json. An answer too large for a
frame is now refused under its ID instead of ending the bridge.
Implements the broker half of OW-1 to OW-5, OW-8 and wide runs from docs/crew/design/open-workspaces-and-automatic-setup.md:

- Workspace.governance (managed by default, stored only when open) and workspace.set_governance, host and person only.
- Under open governance every active member renames, archives, invites, adds and removes people (never a channel's owner), joins teams and channels on their own (team.join, channel.join) and admits joiners; additions no longer move the policy epoch, and admission, team.create and channel.create put everyone where they belong. The snapshot lists joinable teams and channels.
- channel.delete and team.delete remove live state with map removals only, files after the commit, and leave messages unreadable in place; workspace.delete commits a tombstone, refuses everything but hello, and erases only the broker's own files after 30 seconds. biorouter-crew delete does the same offline.
- workspace.context.set/get with a revision check, at most 64 KiB, readable by every member and agent.
- run.create accepts up to 100 source channels.
- Capabilities open_governance_v1, delete_v1, workspace_context_v1 and wide_runs_v1 after presence_v1, and the remote-folder refusal now says where the folder is set.
…document

open_governance_contract: managed rules refuse what open rules allow (renames, archives, invitations, direct adds, removals, joins, admitting joiners), host-only actions stay the host's, admission and creation put everyone where they belong, additions keep agent grants running while removals end them, joinable lists, 100-source runs, the reworded remote-folder refusal, capability order, and no worker grant can do any of it.

delete_contract: channel and team deletion remove state and attachment files, keep messages unreadable, replay after a restart and never patch the messages array; who may delete under each governance; the workspace tombstone refuses everything but hello; the erase removes only broker files; a half-erased directory never reopens; the offline delete refuses a running broker and the wrong ID; a real broker erases itself after the grace period (Linux, ordinary user).

workspace_context_contract: who writes it, revision conflicts, size and character rules, share accounting, and worker reads.
…t document

Method table rows for the open rules and the eight new methods, the capabilities appended after presence_v1, new Governance, Deleting and Workspace context document sections, the offline delete command, hello and status in the deleted state, 100-source runs, the worker allowlist, the reworded remote-folder refusal, headroom and share lists, and the durability paragraph's account of what deletion removes and what stays in the journal.
…orage wait

The supervisor checks for a recorded cancel before it starts the command
and on every poll, so a cancel that raced the start is honored.
remote.hash stops at 1 GiB, since the relay waits for it. The probe asks
every filesystem at once within one shared five-second bound, and skips
the single files a container bind-mounts under /etc.
…o claude/crew-auto-setup

# Conflicts:
#	crates/biorouter-crew/src/broker.rs
#	crates/biorouter-crew/src/main.rs
…on, setup access and storage, CLI, UI) and update the Crew manual
…ibe them in the design contract, and keep the keepalive fake's hello reply free of a fork
…haviour change, so the too_many_lines baseline holds
…e idle or offline

The broker leaves a tombstone naming the workspace in its runtime directory when it erases a deleted
workspace; a member's bridge that finds no broker but that tombstone answers workspace_deleted; the
daemon records it from that answer and from a hello that says deleted, stops redialling, and answers
crew_workspace_deleted (409 on connect).
…d port as the invitation's login

Only an alias Crew can connect through qualifies (no RemoteCommand, no own ProxyCommand or delegated
credentials that the connection preflight refuses); a typed login, port or jump host still wins.
…w join sets it up, and say how to turn access on after joining
…what open workspaces do in the welcome and let-in copy
… who was offline learns the host deleted the workspace
…channel notice, a Deleted by host status, the remove confirmation, and no Reconnect
…spawn_serve_daemon, declared_public_url), with no behaviour change
mentions_status read 429 in a model name's hex suffix (deepseek-r1:8b-75faa429a979...) as a rate
limit, so a refusal was classified transient and retried; this made an Ollama test flaky on CI. A
code must now stand apart from letters as well as digits.
… Crew's unix-only probe and full-access modules from the console census
@Broccolito
Broccolito merged commit 474afc6 into main Oct 18, 2026
24 checks passed
@Broccolito
Broccolito deleted the claude/crew-auto-setup branch October 18, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant