| Files | Last commit | Last update |
|---|---|---|
fix: remove the macOS command host (#414) * refactor: remove the macOS command host Every CLI call and batch item now runs in its own process, as on Windows and Linux, instead of being forwarded to a long-lived background host. - delete src/command_host, its process test and the libc dependency - drop the forwarding branches in main and batch, needs_caller_process, and the host env scrubbing in the permission guide - add a process test that commands start no host and connect to no host socket - ask macOS users upgrading from 0.10.0 or later to restart once, note that permissions apply per CLI call, and that old refs must be retaken * fix(macos): find leftover command hosts by process, not by file Leftover hosts are now found from this user's process list: a shipped agent-desktop executable whose environment carries the host marker. Each one is checked by owner and start time before SIGTERM, and stopped with SIGKILL if it is still running after 500 ms. The cleanup no longer reads or depends on any file, so the old socket directory does not matter. * fix(macos): stop leftover hosts whatever the executable is named Old hosts are found by the environment marker alone, since a copied or renamed binary still carries it. npm install now runs the new binary once on macOS, so a leftover host stops at upgrade instead of at the next call. Tested against real 1.0.2 hosts, including one started from a renamed copy: both stop on npm install and the bin entry stays hard-linked. * refactor(macos): trim the leftover host stopper The first agent-desktop call after the upgrade stops old hosts, so the npm install step is not needed. Old hosts have no SIGTERM handler, so SIGTERM alone ends them and the grace wait and SIGKILL are gone. The tests keep the cases that guard safety: only an exact environment marker counts, unmarked processes are left alone, and no command reaches or removes a host socket. Checked against two real 1.0.2 hosts, one started from a renamed copy: both exit after one new call. * fix(macos): stop leftover hosts with SIGKILL A host started with SIGTERM ignored, or one that is stopped, survives SIGTERM. The process is chosen by its owner and environment marker, so the signal adds no risk to other processes. * fix(npm): stop leftover macOS hosts during install Without this, an old host keeps serving between the upgrade and the first agent-desktop call. The install runs the new binary once after linking on every successful path. A failure only warns and names the command that stops the hosts; the install and the link are unaffected. Calls still stop hosts too, which covers installs that skip scripts. * fix(macos): note the repeated-row ref limit and cheapen the host sweep Without the host, a ref to a row in a list whose rows share an identifier can act on another row after the list changes. The CHANGELOG and the macOS skill say so, and ref_churn skips the checks that relied on the host until identity-based resolution lands. The sweep now reads each process's arguments once into a reused buffer and checks start times only for marked processes, which cuts its cost from about 5.7 ms to about 4 ms per call on a Mac running around 730 processes. Checked in a VM against real 1.0.2 hosts: normal, renamed, and one ignoring SIGTERM while stopped all exit. Also: the decoy-socket test fails if any other host file appears, a new test proves a marked copy running version is not killed, the stale host-kill loop is gone from the E2E harness, and the identity doc now limits its retained-token claim to macOS. * fix(macos): stop only agent-desktop hosts and drop the pinned namespace The sweep killed any process with the old host marker in its environment, including a test Python process. It now also requires the running process's code-signing identifier to be agent-desktop's, read with csops. Every release is ad-hoc signed by cargo with an identifier like agent_desktop-<hash>, which survives renaming and deletion of the executable, so renamed and unlinked hosts are still stopped. The check runs only for marked processes, so the per-call cost does not change. Checked in a VM: real 1.0.2 hosts (normal, renamed, and one ignoring SIGTERM while stopped) exit after one call, and a marked Python process keeps running. The pinned session namespace had no production caller once the host was gone, so its field, builder, guards and tests are removed. * chore(architecture): refuse any new listener and the removed host marker Every CLI call is its own process that serves nothing. The architecture check now fails when production code opens a socket, TCP, UDP or named-pipe listener outside a reviewed allowlist (Chrome's debug-port probe and the two cursor overlay endpoints), or names the removed command host's environment marker outside the code that stops leftover hosts. Test files and inline test modules are not scanned. Each case is planted in the self-test, and a stale allowlist entry fails too. | 6 days ago |