oliver-zehentleitner / maity

cli: maity runner init, an interactive setup that asks for harnesses and prepares the machine

Sign in to report

tsk-fv7apqnv5yw2 Open

The maintainer, 2026-11-17 (chat 149314): "warum trägt er claude ein? was wenn einer was anderes will? eigentlich wäre ein init befehl gut der das abfragt und das environment herrichtet".

Today the starter configuration (web runners.js starterConfig, and pair without a configuration) always writes [harness.claude-code] only. Someone who wants Codex, Antigravity or OpenCode has to know the TOML by heart, and check reports only what is configured.

Build maity runner init, an interactive setup after pair, idempotent and safe to run again:

  1. It asks which harnesses to run (Claude Code, Codex, Antigravity, OpenCode, more than one allowed) and their modes. For Claude Code and Codex it offers the managed install (install = true, update = "daily", §"Keeping Claude Code and Codex current").
  2. It asks for the projects and repositories (offering the ones the hub has attached the runner to), the [git] identity, and max_agents.
  3. It writes runner.toml. An existing file is shown as a diff and changed only after a yes; keep a backup.
  4. System packages: it checks tmux, bubblewrap and socat (Linux), gpgv (managed Claude Code) and git. It installs nothing with sudo itself: it prints the one command for the detected OS (apt/dnf/pacman/brew) and waits, or exits telling the user to run it.
  5. It installs the managed tools now, if chosen, then runs check, and on Linux with systemd offers maity runner install.
  6. --non-interactive with flags for scripts.

Also: the web's starter configuration and the pairing steps stop assuming Claude Code. They point to maity runner init as the next step after pair. Coordinate with tsk-vg1yqpf586wq (pairing steps), which touches the same page.

Plan to the lead before the first push. CLI tests, docs/runners.md and cli/README.md in the same PR, plus a KTW entry for why init prints the sudo command instead of running it.

Notes

  1. Lotse · Nov 17, 2026, 10:56 UTC

    Found on 2026-11-17 with the maintainer's second runner: sudo maity runner install only fits its own fixed layout (/etc/maity-runner, /var/lib/maity-runner, a system user it creates). It refuses an existing maity-runner account without its install record. The setup the web pairing leads to is a normal user with everything under its home, paired already, with maity from pipx in ~/.local/bin. For that setup our two runners use the shipped unit with two lines changed: ExecStart=/home/maity-runner/.local/bin/maity runner serve (no --config) and ReadWritePaths=/home/maity-runner /tmp.
    So init (or install --user-layout, the coder decides) should set up the service for the layout pairing actually produces: detect the user, home, maity path and config, write the unit, daemon-reload, enable --now. The docs must stop pointing a paired home-layout runner at install.

  2. Lotse · Nov 17, 2026, 12:34 UTC

    From the ops setup on 2026-11-17 (seq 151236), also for init: an optional headless browser with its AppArmor profile (Ubuntu 23.10+ blocks unprivileged user namespaces, so Playwright's headless shell fails with "No usable sandbox"; snap chromium refuses non-snap sessions), and creating ~/.local/state/maity with mode 0700. The full needs list is the new card tsk-r1a5g6jxk1yj.

  3. Lotse · Nov 17, 2026, 13:34 UTC

    From the maintainer, 2026-11-17 (chat 151738), for init: agy installs with Google's script curl -fsSL https://antigravity.google/cli/install.sh | bash, run as the agents' user. init should offer it as a choice, run it with the user's consent (vendor script, so say so), then have the user sign in once with agy.

  4. Lotse · Nov 17, 2026, 13:47 UTC

    From ops on OLIVER-PC01-L, 2026-11-17 (maity-ops-team#3yc2, seq 151829). The maintainer added a per-binary AppArmor profile for ~/.local/bin/agy, but the antigravity namespace warning in maity runner check stays. The reason: agy_namespaces() (cli runner/capabilities.py:319-331) probes /usr/bin/unshare as the agents' user, so on Ubuntu 23.10+ it reports what an arbitrary process may do, not what agy may do.

    For init and check:

    • probe under agy's own profile (aa-exec -p <profile> unshare …), or detect and name the profile;
    • have init install the agy profile, and the headless-browser profile, with consent.

    The only other way to clear the warning is the system-wide sysctl kernel.apparmor_restrict_unprivileged_userns=0. Don't recommend it. Whether agy's sandbox really starts with the profile is not verified yet.

  5. Lotse · Nov 17, 2026, 14:11 UTC

    From OLIVER-PC01-L, 2026-11-17 (maity-ops-team#3yc2, seq 151956). The systemd unit starts maity runner serve without ~/.local/bin on PATH, and runner.toml had no agent_path. So agy (in ~/.local/bin) was binary_not_found, and maity itself was not on the agents' PATH. Every placed agent there would have failed to run maity. maity runner check passed anyway, because it uses the caller's shell PATH, not the service's.

    For init/install/check:

    • runner install (and init) writes a PATH or agent_path that includes the pipx bin dir and ~/.local/bin.
    • runner check checks with the PATH the service will have, not the shell's.
  6. Lotse · Nov 17, 2026, 15:27 UTC

    From OLIVER-PC01-L (Ubuntu 26.04), 2026-11-17 (maity-ops-team#3yc2, seq 152527).

    The apparmor package ships the profile bwrap-userns-restrict. Processes bwrap starts run under unpriv_bwrap, which denies capabilities, so a bwrap inside a bwrap cannot create namespaces ("No permissions to create a new namespace"). As a result, a placed Claude Code agent's shell failed entirely.

    maity runner check only tests that bwrap and socat exist, and said ok.

    Wanted:

    • check (and the start) runs the real probe the harness needs, including the nested case where it applies.
    • It reports this AppArmor restriction by name, with the documented fix.
    • Codex's own codex sandbox -- true probe passed there, so check should verify each harness's sandbox the way the harness actually uses it.
  7. Lotse · Nov 17, 2026, 15:29 UTC

    From OLIVER-PC01-L, 2026-11-17 (maity-ops-team#3yc2, seq 152553). A Codex placement never started its loop: its tmux pane stood at Codex's first-run "Folder access" dialog for the untrusted workspace (Open restricted / Back), with nobody to answer it. Wanted: the runner starts Codex with the workspace trusted (a -c projects."<ws>".trust_level=... override or a written config the runner owns), and check/the start report a harness that waits on an interactive prompt instead of showing it as running.