8 Commits
Author SHA1 Message Date
CatoandClaude 169f920055 fix(desktop): Linux AppImage keeps the Chromium sandbox on (#1521)
Every Linux launch passed --no-sandbox. afterPack.cjs wrapped the
Electron binary in a stub that added it unconditionally, the .desktop
Exec= line carried it (electron-builder's AppImage default), and the
systemd unit from install-fleet-runner.sh passed it again. The reason
was real but narrow: inside an AppImage the setuid chrome-sandbox can
never work (the FUSE mount is nosuid), so where unprivileged user
namespaces are also blocked Chromium aborts at FATAL. Everywhere else
the namespace sandbox works without any setuid helper, and the flag
switched off the renderer sandbox #1479 had turned on.

- desktop/scripts/linux-launcher.sh replaces the stub. It runs
  Chromium's own probe (create a userns, write its maps, nest another)
  and the setuid-helper check for .deb installs, and passes
  --no-sandbox only when neither is available (or as root). It then
  prints why and how to fix it, and sets FLEET_RUNNER_SANDBOX_OFF.
  It also reports a --no-sandbox that arrives on argv, including the
  one electron-builder's AppRun appends silently.
- The main process shows that reason as a notification.
- linux.executableArgs is [] so the .desktop entry stops passing it.
- The systemd unit no longer passes --no-sandbox.
- The stale-instance pgrep no longer requires --no-sandbox in argv.
- Packaged-build test: test-linux-sandbox.sh starts the real AppImage
  under Xvfb and checks the live process tree (main argv; renderer
  seccomp-bpf and its own user namespace). ci-linux-sandbox.sh runs it
  with Ubuntu's userns restriction off (must be sandboxed) and on (must
  still start, with the notice). New PR workflow
  desktop-linux-sandbox.yml, and a step on the Linux release build.
- Version 0.8.62 with its changelog entry.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:18:22 +01:00
CatoandClaude Fable 5.1 5990c3fe68 feat(runner): one substrate — Fleet Runner owns every agent PTY, zellij is gone (#624)
The "Could not bring zellij up" toast fired on every Fleet Runner boot. It
came from a cold-start that could not work: `restoreFleetOnBoot` fetched the
user's last runtime snapshot — whichever channel pushed last, so on the laptop
it got the box's fleet with `/home/ubuntu` paths — wrote a zellij layout for
it, and spawned `zellij --session fleet --layout` detached with no TTY. A
zellij client needs a terminal to bring up its server; probed three ways on
2026-09-11, that spawn never produced a session, every time. The toast said
"Open Settings to retry"; Settings had a Restoration section that the desktop
never read (autoRestore hardcoded true) and no retry.

Since 0.8.3 the owned PTY was the default with zellij kept as the fallback for
tabs it could not find. The fallback is where every stuck dispatch ended:
"no zellij tab with that name in any active session" (2026-09-10 21:08, an
inject into Heidi), a keystroke typed into "Tab #9", a session spawned that no
terminal could show. This release deletes the fallback instead of hardening it
a fourth time.

Runner:
- poller: inject requires a live owned PTY and fails loudly otherwise (the
  cloud enqueues a DISPATCH for a project with no session, so a miss is a
  real error); launch/dispatch/switch own the PTY with no fallback; close and
  peek answer from the PTY or say there is none; focus_tab is retired;
  install_cli runs the installer in an owned PTY; the zellij session/tab
  helpers, the pre-flight `ensureSessionForCommand`, the ETIMEDOUT
  translation, and FLEETCROWN_RUNNER_PTY are gone.
- pusher: open tabs are the owned PTYs; pane records no longer join through
  ZELLIJ_PANE_ID or stamp a session name.
- index: no cold-start on boot, no bundled-binary PATH prepend, no zellij in
  the prerequisites scan; peek-tab reads the owned buffer.
- desktop/scripts/download-zellij.mjs and the prebuild download are deleted.

Web (the pieces that existed only for the cold-start):
- /api/control/runtime-state/desired (cross-channel snapshot read) deleted.
- Settings → Agent → Restoration (FleetLifecycleSettings + its API) deleted;
  the users.fleet_settings column stays (migrations never DROP) and is unread.
- src/lib/zellij-bootstrap.ts and zellij-layout-generator.ts deleted.

Fleet Runner 0.8.19; changelog entry written for the person who installed it.


Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 02:12:33 -07:00
3f00db0f2d fix(desktop): publish macOS + Windows again, ship a usable Linux icon, unbreak a time-bomb test (#157)
* fix(desktop): publish every platform again, and ship a usable Linux icon

Three defects, one shared cause: a release step that could fail or be
skipped without anyone noticing.

1. Releases stopped shipping macOS and Windows after v0.8.6.
   1d16150 pointed electron-builder's `publish` at fleetcrown-releases while
   CI still handed it the default GITHUB_TOKEN, which has no write access
   there — so `--publish always` 403'd and the tagged matrix died. 0.8.7,
   0.8.8 and 0.8.9 were cut by hand from a Linux box instead, leaving
   macOS and Windows users three versions behind with no way forward.

   The build job now never publishes; it only uploads artifacts. A new
   `mirror` job assembles the release from those artifacts and pushes it to
   fleetcrown-releases with RELEASES_REPO_TOKEN, under the fleet-runner-v*
   tag the marketing URLs already resolve to. `needs: build` means a partial
   matrix can never ship, and if-no-files-found is now `error`, so a silently
   empty macOS or Windows artifact fails the run instead of quietly
   producing another Linux-only release.

   It reuses scripts/mirror-desktop-release.sh — the step that was supposed
   to be run by hand after every release, and wasn't. One implementation of
   "how a release is assembled", now actually executed.

2. The Linux launcher icon was blank on KDE.
   `linux.icon` pointed at a single 1024x1024 png, which electron-builder
   hands to fpm verbatim: it installed exactly one file, into
   hicolor/1024x1024 — a bucket no panel looks in at 32px. Now a directory
   of nine sizes, rasterized from the SVG SSOT at each size rather than
   downscaled, so the 16px glyph stays legible.

   Verified: the .deb goes from 1 icon entry to 9 (16 through 1024).

3. That class of bug can no longer ship.
   generate-tray-icon.mjs already guarded the three committed brand PNGs;
   it now guards every icon size too, and fails with the exact fix command.
   Deleting one size fails the build instead of silently producing a
   blank-icon installer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(test): pin the clock in autopilot-eligibility so it stops grading itself against today

The suite defines `NOW = 2026-08-02T12:00:00Z` and builds every fixture
relative to it, but `nowMs` was an optional per-call argument and 8 of the 14
calls omitted it — those read `Date.now()` instead. So a fixture written as
"one minute old" was one minute old only while the wall clock sat near NOW.
Two days later it is two days old, the staleness paths
(WORKING_CLAIM_TTL_MS / BLOCKED_RECHECK_TTL_MS) fire, and assertions that
have nothing to do with time start failing. It went red on 2026-08-04 with no
code change behind it, blocking every push via the pre-push hook.

The parity check had the same flaw in sharper form: it asserts the scheduler
and the Control page "reach identical verdicts from identical facts" while
pinning the scheduler's clock and letting Control read the real one. The
clock IS one of those facts, so it was manufacturing a divergence that said
nothing about the SSOT property under test.

Both paths now go through helpers that inject `nowMs: NOW` by default —
`dispatchAt()` and `gatesAt()` — with an explicit `nowMs` still overriding
for the cases that are genuinely about elapsed time. Fixing the 8 call sites
individually would have left the next added test free to forget again; making
the pinned clock the default removes the option.

Verified by moving NOW to 2020-01-15: all 14 cases still pass, so the suite
no longer depends on when it runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 15:40:26 +02:00
Mao NakamotoandClaude Opus 4.8 e76211aebf feat(brand): dense-coil spiral SSOT, Geist type, dark-first
One source for the brand mark (src/config/brand-mark.ts): a dense Archimedean
spiral that pulls into the center. `npm run generate:brand` renders every asset
from it — favicon, apple icon, 1024px app icon, the monochrome tray glyph, and
the OG marks — replacing the divergent hand-drawn copies and the wrong
"control-window" tray glyph. The desktop step now verifies committed icons
instead of redrawing them.

Also: switch typography to Geist + Geist Mono (the x.ai/grok grotesk) via the
--font-* token SSOT, default the theme to dark (Settings toggle still
overrides), and give the in-app mark a slow rotation + soft glow
(reduced-motion safe).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 14:23:25 +02:00
Mao NakamotoandClaude Opus 4.7 60b828ac98 fix(desktop): v0.4.3 — afterPack wraps Electron binary with --no-sandbox stub
v0.4.2 set linux.executableArgs: ["--no-sandbox"] but verification on a
fresh AppImage download showed it STILL crashed at FATAL setuid_sandbox_host.
Inspected the generated AppRun script and confirmed the flag was missing:
electron-builder only injects executableArgs into the .desktop file's
Exec= line, not the AppRun. So OS-menu launches via .desktop worked but
direct execution of the AppImage (double-click, ./binary from a shell,
electron-updater swap) did not.

Fix: a custom afterPack hook (desktop/scripts/afterPack.cjs) wraps the
real Electron binary in a small shell stub that bakes --no-sandbox into
argv before exec'ing the real binary. The AppRun unknowingly invokes the
wrapper, which in turn invokes the real binary with the flag. This is
the pattern Slack, Discord, VSCode, Cursor, and Obsidian all use.

Layout in appOutDir after afterPack:
  fleet-runner      ← bash wrapper (new, 0755)
  fleet-runner-bin  ← real Electron binary (renamed from fleet-runner)

Idempotent: skips if -bin already exists, so multi-arch builds don't
double-wrap. Scoped to electronPlatformName === 'linux'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 18:23:07 +02:00
Mao NakamotoandClaude Opus 4.7 cfc5d7eb2d fix(desktop): bump icon.png to 1024x1024 for macOS build
electron-builder's macOS target requires icon.png ≥ 512x512; the procedural
generator was emitting 256x256, blocking the macos-latest job in the v0.2.0
release with:

  ⨯ image desktop/resources/icon.png must be at least 512x512

Bumped to 1024x1024 (retina-ready) — well above the minimum and macOS's
iconset generation downscales automatically. Linux/Windows already accepted
256 so this is purely additive there.

Unblocks the macOS build leg of the fleet-runner-v0.2.0 release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 14:35:55 +02:00
Mao NakamotoandClaude Opus 4.7 7b26b90bf7 feat(install): one-touch Fleet Runner install — bundled Zellij, deep-link auth, copy button
Collapses the new-customer install path from "download → install Zellij →
install agent CLI → copy token → paste in app" into "download → click
Open in Fleet Runner". Bumps Fleet Runner to v0.2.0.

Desktop (Fleet Runner v0.2.0)
- desktop/scripts/download-zellij.mjs (new): prebuild fetches the pinned
  Zellij binary (v0.41.2) into desktop/resources/bin/ for the target
  platform; electron-builder packs it into the AppImage / .deb / .dmg.
  Idempotent — skips if the file is already present; FORCE=1 re-downloads.
  Handles linux-x64/arm64, darwin-x64/arm64; PRs add more.
- desktop/src/main/index.ts: bundledBinDir() prepends the bundled binary
  dir to process.env.PATH before any home/ or zellij call resolves, so
  every existing exec("zellij ...") picks the bundled binary first with
  the user's $PATH as fallback. Zero call-site changes.
- desktop/src/main/index.ts: fleetcrown:// protocol handler (single-
  instance lock, mac open-url event, Linux/Win argv scan, cold-start
  buffering). On a deep-link click, the token in ?token=ck_... is saved
  via the same path as manual paste and the poller restarts immediately.
- desktop/package.json: version 0.1.0 → 0.2.0; prebuild now also runs
  bundle:zellij so dist:linux/mac/win all ship the binary.

Web
- src/components/settings/AgentTokenSettings.tsx: "Open in Fleet Runner"
  button next to the freshly-revealed token, hrefed to
  fleetcrown://auth?token=<token>. Falls back gracefully if Fleet Runner
  isn't installed or the protocol isn't registered.
- src/components/public/DesktopDownload.tsx: CopyableCommand wraps the
  CLI command shown after download with a Copy button (Check icon for
  2s on success). Clipboard API failures are silent — the code stays
  selectable.
- src/app/globals.css: ui-public-download-command-row + -copy classes
  to keep the SoC of the public-download surface intact.
- src/config/marketing-content.ts: install copy rewritten around the
  new one-touch story (Linux command uses ~/Downloads/Fleet.Runner-*
  wildcard; Claude Code becomes required since shipped agents don't ship
  with a bundled CLI; prerequisites prose tightened).

.gitignore: excludes desktop/resources/bin/ — the binary is fetched at
build time, not source-controlled (10MB+ per platform).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 13:14:15 +02:00
Georgy ButaevandClaude Opus 4.7 8fc676c488 feat(desktop): OS notifications on worker.idle + real tray/window icon
Embedded watcher gains an optional onIdle subscriber; the desktop main
process passes a callback that fires an OS notification (with a health
badge prefix and the handoff "done" line) every time a dispatched agent
writes its handoff. Clicking the notification surfaces the main window.
This closes the fire-and-walk-away loop: dispatch an intent, switch
context, get pinged when it lands.

Tray + window icon: replaces the placeholder nativeImage.createEmpty()
with the FleetCrown control-window mark, pre-rendered to PNG by a small
pure-Node generator (scripts/generate-tray-icon.mjs — wired into
prebuild + dev). 22px tray, 44px @2x, 256px window/builder icon. Icons
checked in under desktop/resources/ with a targeted gitignore exception
so packaged binaries pick them up without a build step. electron-builder
config gains buildResources + extraResources so the PNGs ship with
AppImage / deb / dmg / nsis.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-02 17:04:14 +02:00