Skip to content

fix(cli): a Connect-page seat starts with the daemon's default environment, on a host that can run it - #2288

Merged
lilyshen0722 merged 4 commits into
mainfrom
lily/cli-host-sandbox-preflight
Oct 17, 2026
Merged

lilyshen0722 merged 4 commits into
mainfrom
lily/cli-host-sandbox-preflight

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What changes

commonly agent run started with the Connect page's env vars (COMMONLY_API_URL + COMMONLY_AGENT_TOKEN) now:

  1. Saves the seat with the daemon's default environment. bootstrapAgentRecordFromEnv uses seatBaseline(…, { sandbox: true }), the same baseline daemon-supervisor applies to a seat nobody wrote a spec for. The seat's mode resolves per host: Seatbelt on macOS, bubblewrap on Linux. pi is unchanged; it gets the kernel MCP server and no sandbox block, as before.

  2. Checks the host can run it, before it saves a token or polls (lib/sandbox/host-check.js). Native Windows stops with three ways forward: WSL, the MCP connection, or a hosted agent. Linux without bubblewrap stops with the install line. Codex (its own permission profiles) and pi are not checked.

  3. Prepares the commonly MCP build before the first poll (lib/mcp-first-run.js). Public seats run MCP only from a host-prepared build (TASK-273). On a machine with none, the first spawn used to start the build and refuse the turn, so the person's first @mention waited for the kernel to re-send it.

  4. Says which CLI it picked. When the first CLI in the detect order is missing, agent run names the missing ones and the one it is running with. Before, it quietly started a different agent CLI than the Connect page named.

  5. On Windows, "no supported agent CLI found" also prints the Windows directions. Usually this means Claude Code was installed with npm: a .cmd shim, which Node can't spawn.

  6. A saved seat whose settings predate the default sandbox starts with one line saying how to reconnect and pick it up. Saved records are not rewritten.

  7. A public Claude Code seat on Linux (WSL included) stops at start, with two options: the MCP connection or a hosted agent. On an ubuntu-24.04 runner (run 38982219348), a confined spawn could not start Claude Code at all: bwrap: execvp …/.local/bin/claude: No such file or directory. The namespace binds the system binary folders only, and Claude Code installs under the home folder or /usr/local. With Ubuntu's default AppArmor the namespace itself is refused (setting up uid map: Permission denied). The Windows directions for Claude Code no longer offer WSL for the same reason. Making Linux Claude seats run under bubblewrap is a follow-up.

    • OpenCode and Qwen are left as they are: their adapters bind their own binary, node, home and MCP folders into the namespace. They are not re-measured on Linux in this PR.
    • Codex does not use bubblewrap.

The bubblewrap messages now give the install commands (apt, dnf, pacman). They no longer suggest sandbox.mode: none, which public seats refuse.

cli 0.1.106.

Proof

Unit and wiring tests:

  • host-sandbox-preflight.test.mjs: the check per host, plus the real agent run action reporting win32. It exits 1 with the directions, writes no token file, and makes no second API client. Mutation check: removing the call from the run action fails the wiring arm.
  • mcp-first-run.test.mjs: warms only for a public seat whose MCP home is empty; a failed warm is reported and the run continues.
  • attach.test.mjs: the bootstrapped record carries sandbox: { trust: 'public' }, and a pi record carries none. The fall-back to a later CLI is reported, and the first CLI found reports nothing. No CLI at all throws with a code. savedSeatLacksDefaultSandbox covers its six cases.
  • host-sandbox-preflight.test.mjs also covers, through the real run action: Windows with no CLI found prints the directions and writes no token file, and a saved pre-sandbox seat prints its one line before polling.

Mac, on production, with the packed 0.1.106 tarball and Node 22:

  • Fresh HOME: the first-run step prepared the MCP build in 2.2 s, then polling started.
  • With the real HOME, since Claude's login is HOME- and Keychain-scoped (clean-box-smoke.sh notes this): the first @mention was answered in 17.8 s. A read outside the seat's workspace was refused.

Windows (windows-latest, Windows PowerShell 5.1, per-user npm prefix, no admin), on a scratch branch that is never merged:

  • Run 38976026639 installed this branch's packed tarball and ran commonly agent run against a local stand-in API with a fake token. It stopped at start with the directions and wrote no token file.
  • The same run showed why the no-CLI case gets the directions too: an npm-installed Claude Code (a .cmd shim) is not spawnable from Node, while the native-installer claude.exe is.
  • The directions say WSL 2, because bubblewrap needs it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG

lilyshen0722 and others added 3 commits October 16, 2026 15:27
…nment, on a host that can run it

`commonly agent run` with the Connect page's env vars now:

- saves the seat with the same default environment a daemon-derived seat
  gets (seatBaseline, sandbox included), so its mode resolves per host:
  Seatbelt on macOS, bubblewrap on Linux;
- checks, before it saves a token or polls, that this host can run the seat
  that way. Native Windows stops with three ways forward (WSL, the MCP
  connection, a hosted agent); Linux without bubblewrap stops with the
  install line;
- prepares the commonly MCP build before its first poll when the machine
  has none, instead of refusing the person's first @mention and waiting for
  the kernel to re-send it.

The bubblewrap messages name the install commands (apt, dnf, pacman) and no
longer suggest a sandbox mode that public seats refuse.

cli 0.1.106.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG
… options when none is found

- When the first CLI in the detect order is missing, `agent run` says which
  ones it did not find and which it is running with, instead of quietly
  starting a different agent CLI than the Connect page named.
- On Windows, "no supported agent CLI found" is usually an npm-installed
  Claude Code (a .cmd shim Node cannot spawn), so that error now also prints
  the Windows directions.
- A saved seat whose settings predate the default sandbox starts with one
  line saying how to reconnect and pick it up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SECURITY-GATE: PASS @ 84432d1. Independent security read (Cofounder operator session with a separate reviewer; not a Commonly seat).

  • Connect-page seats get the default public environment for every adapter, with or without --adapter. Where the host can't confine, the adapters refuse rather than spawn.
  • The preflight reads no env or flag. The platform comes from process.platform, and the macOS check runs the real sandbox binary.
  • Nothing is persisted before the preflight passes (on refusal, no file is written).
  • The confinement profile matches daemon seats.
  • PR suites 76/76, related sandbox suites 246 pass. A live local probe on darwin wrote a record with the public sandbox for claude and for codex.

Follow-ups are tracked separately.

GATE: PASS

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written by sprint-review, a Commonly agent — code gate at 84432d11b. pod thread

Base c01b38fd0, merge CLEAN, head unchanged across the measurement. Tier 1 green at this exact head: run 38977102240. Full cli suite at this head: 66 suites / 1205 passed, 16 skipped.

Nine mutations, each red by name

BASE and RESTORED both 3 suites / 76 passed over host-sandbox-preflight, mcp-first-run, attach:

mutation failures
W1 the host check moved after the token save 2 — the env-token first run stops before saving a token or polling, and says what to do, on Windows, finding no CLI at all also prints the directions
W2 win32 no longer refuses 4
W3 bwrap detection ignored 1 — on Linux, a missing bubblewrap stops the run with the install line
W4 seatbelt detection ignored 1 — on macOS the seat runs when Seatbelt is there, and is refused with the reason when it is not
W5 the adapter whitelist widened 1 — adapters these mechanisms do not confine, and seats with no enforced mode, are left alone
W6 the WSL 2 wording reverted to WSL 1
W7 the warm's home-empty gate dropped 1
W8 the warm's public-trust gate dropped 1
W9 bootstrap stops applying the default sandbox 3

Property (1) holds, and the win32 arm is not the only thing holding it. The load-bearing change is structural: saveAgentToken moved out of the bootstrap branch to after the refusal check, so the only path to a token file now runs through it — W1 reds two arms. And the wiring keys on the returned string (if (hostRefusal)), never on the platform, so the win32 arm exercises the same branch a Linux-without-bwrap refusal takes; the per-platform refusal computations have their own arms, which W3 and W4 red. The MCP warm and the poll both sit after the check in source order.

Property (2): three gates — public trust, a commonly entry in environment.mcp with an array command, and plan(...).reason === 'home-empty'. W7 and W8 each red the arm that names all three.

Property (3): the whitelist is Object.prototype.hasOwnProperty.call(ADAPTER_LABELS, adapterName) rather than in, so codex, pi and any __proto__-shaped adapter name fall through to null. W5 reds the arm.

The Windows artifact: what it pins, and what it cannot

Run 38976026639 succeeded, but its headSha is 1e106b7eb — a scratch commit that contains neither new file (git ls-tree: host-check.js and mcp-first-run.js ABSENT) and carries the pre-PR agent.js blob 5e9391673, which is this PR's own "before" side. It is not an ancestor of the gated head.

That is not a hole, because the workflow installs the CLI separately: it checks out the fix branch into fix\, runs npm pack there and npm i -g the tarball. So the binary under test was the fix branch's. But the run's sha cannot say which fix-branch commit was packed, and the log answers that itself — it prints

  - WSL (Ubuntu): install Node and Claude Code inside WSL, run `sudo apt install bubblewrap`, ...

while the gated head says - WSL 2 (Ubuntu), and this head's own commit subject is "the Windows directions say WSL 2, which bubblewrap needs". So the artifact demonstrates the stop and the three ways forward, on a build one commit older than the one being gated; it is not evidence for the wording that shipped. That string has its own arm — host-sandbox-preflight.test.mjs:60 asserts WSL 2 (Ubuntu) — and W6 reds it. Worth stating because "windows-latest run 38976026639, where the run stops with the directions" reads as covering the whole message, and the one part it demonstrably does not cover is the part this head changed.

Two harness errors of mine, so nobody repeats them

  • My first full cli run reported 2 failed in mention-event-types.contract.test.mjs. That was my worktree: the suite spawns the backend under ts-node, and I had symlinked only cli/node_modules. With backend/node_modules linked the suite passes. I nearly reported a red baseline on this PR.
  • A backgrounded mutation run was killed mid-flight and left the W1 mutant in the worktree. My next isolated run of host-sandbox-preflight then reported 2 failed / 9 — which I was one step from reading as a baseline failure. git status --porcelain in the worktree caught it; restored, BASE re-established at 76/76, and the whole battery re-run from clean. (The accidental result agrees with W1 above.) Separately, these suites need --forceExit when run alone — without it jest hangs on an open handle, which is what killed the first battery.

GATE: PASS

…ith its two options

On Linux the bubblewrap namespace binds the system binary folders only, and
Claude Code installs under the person's home or /usr/local, so a confined
spawn could not start it (ubuntu-24.04 run: `bwrap: execvp
…/.local/bin/claude: No such file or directory`; with Ubuntu's default
AppArmor the namespace itself is refused). Until the namespace carries what
Claude Code needs, `agent run` refuses a public Claude seat on Linux before
saving a token or polling, and names the MCP connection and a hosted agent.

The Windows directions for Claude Code no longer offer WSL. OpenCode and
Qwen bind their own binary, node and home into the namespace and are left
as they are; Codex does not use bubblewrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SECURITY-GATE: PASS @ 3d3dbe9. Delta re-read of 84432d1..3d3dbe9 (Cofounder operator session; not a Commonly seat). Carries forward the independent read at 84432d1.

  • The delta is 2 files: cli/src/lib/sandbox/host-check.js and its test.
  • hostSandboxRefusal now refuses a public Claude seat in bwrap mode before any detection. This is strictly more restrictive: it adds a refusal and removes no check.
  • The Windows directions drop the WSL option for Claude only. OpenCode and Qwen keep it.
  • Order is unchanged: the win32 refusal still comes first, and the Seatbelt path is untouched.
  • Nothing is persisted before the refusal (same call site as before).

GATE: PASS

samxu01 pushed a commit that referenced this pull request Oct 16, 2026
…inux with Codex

The CLI (#2288) now stops a Claude Code listener on Linux or WSL at start:
under bubblewrap a confined spawn could not even start Claude Code
(ubuntu run 38982219348), and native Windows has no sandbox for either CLI.
The Connect page follows:

- The switch is Mac · Linux · Windows, defaulted from the browser. Detection
  matches browser spellings only, so jsdom's "(linux)" on a CI host does not
  flip the page.
- Mac, and Linux with Codex: the listener command, unchanged.
- Claude Code on Linux or Windows: no listener command. A line says why and
  points to the MCP command below and to "Run it here"; the MCP box is
  titled and worded as the way in, not an extra.
- Codex on Windows: the same, pointing to "Run it here" or another machine.
- Windows keeps the PowerShell MCP lines; WSL is no longer offered.

zh-CN through the zh-cn-ui-localization two passes; `os` is declared an
opaque placeholder in the spacing guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written by sprint-review, a Commonly agent — code re-gate at 3d3dbe9ec, superseding my PASS at 84432d11b. pod thread

Delta since the head I gated is host-check.js plus its test (git diff --name-only), so the rest of my previous measurements stand. Tier 1 green at this head: run 38982649279. The three named suites: 3 suites / 77 passed (was 76; the new arm). Merge CLEAN.

The property, probed with spy detectors rather than inferred

I injected counting detectBwrap/detectSeatbelt and read both the verdict and which detector ran:

linux  claude    detectors=[]       -> Commonly runs a connected Claude Code inside a sandbox, an…
linux  opencode  detectors=[bwrap]  -> This seat runs in a bubblewrap sandbox, which is not avail…
linux  qwen      detectors=[bwrap]  -> This seat runs in a bubblewrap sandbox, which is not avail…
linux  codex     detectors=[]       -> null (runs)
linux  pi        detectors=[]       -> null (runs)

bwrap present:  opencode detectors=[bwrap] -> null (runs)   qwen detectors=[bwrap] -> null (runs)
                claude   detectors=[]      -> refused

win32  claude mentions WSL: false     win32 opencode mentions WSL: true
darwin claude detectors=[seatbelt] -> the Seatbelt refusal (path untouched)
linux claude: no sandbox -> runs · mode none -> runs · internal trust -> refused

So: OpenCode and Qwen behave exactly as before on Linux, including the install line and the pass-through when bubblewrap is present; Claude is refused with no detector called; codex and pi are untouched; macOS Claude still goes through Seatbelt. The internal trust → refused row is correct rather than a scope leak — normalizeSandboxTrust maps the legacy internal to public, which an existing arm already pins.

Four mutations, each red by name (BASE/RESTORED 77/77): removing the Linux Claude refusal; moving it after detectBwrap() (reds …before any detection, so the ordering is pinned, not just the verdict); giving Claude the WSL line back on Windows; and taking WSL away from OpenCode.

The Ubuntu evidence proves the ruling — and contains a second failure the preflight still misses

I read run 38982219348 rather than taking the summary. It has two runs, and they fail differently:

  • Run B (namespaces allowed, "closer to WSL"): bwrap: execvp /home/runner/.local/bin/claude: No such file or directory. That is the Claude-specific case, exactly what the new comment describes — the namespace binds system binary folders and Claude installs under $HOME. The ruling is well-founded on this.
  • Run A (Ubuntu default, AppArmor restricting unprivileged namespaces): bwrap: setting up uid map: Permission denied — bubblewrap failing during namespace setup, before it execs anything, so this one is adapter-independent by the log's own ordering.

Run A is the failure class this PR exists to remove, and it is still open for OpenCode and Qwen. detectBwrap (bwrap.js) runs spawnSync('bwrap', ['--version']) — a presence check. On stock Ubuntu the binary is installed and prints its version, so the preflight passes, and then every turn dies with Run A's error while the pod sees nothing: "would start, poll, and fail every turn", which is the sentence in host-check.js's own header.

The fix is one line, and the cited run already executes it as its own step-B gate: bwrap --unshare-all --ro-bind / / true. Making detectBwrap run that instead of --version turns the stock-Ubuntu case into a refusal with directions. Non-blocking here — this PR strictly improves the Claude path and regresses nothing — but it is the same defect one adapter over, with a reproduction already in hand.

Worth stating plainly for the product record

At this head a public Claude Code seat has no listener path on Linux, WSL, or native Windows — MCP or hosted only. That is the ruling, measured, and the messages say so; I am noting it because the Windows text previously pointed Claude users at WSL, and this closes that loop deliberately rather than by oversight.

GATE: PASS

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security gate — #2288 at 3d3dbe9e

Measured at 3d3dbe9ec7fa6ccafedab5db1c2ff7f98dc6ff66 in a detached worktree: base main, merge-base c01b38fd, 4 commits, 9 files, +550/−12.

Baseline. The three named files: 77/77 pass. Full cli suite: 66 suites passed, 1 skipped — 1206 passed, 16 skipped (11 in bwrap.test.mjs, Linux-only; 4 in adapters.opencode.seatbelt.smoke.test.mjs; 1 in adapters.claude.environment.test.mjs). eslint src --ext .js clean. CI at this SHA: 24 check-runs, none failed; the three cancelled entries (ADR numbers are unique, Rule numbers are unique…, Source changed ⇒ version bumped) each have a later success of the same name, so nothing is pending behind a cancel.

Merge. mergeStateStatus: CLEAN. main has moved 5 commits since the merge-base and none of them touches any of this PR's 9 files, so there is no file state here that a squash would compose out of two separately-cleared branches. main's cli/package.json is still 0.1.105, so the bump to 0.1.106 does not collide.

Enforcement mechanism untouched. The one enforcement-path file in the diff, cli/src/lib/sandbox/bwrap.js, changes message strings only — MACOS_MESSAGE and detectBwrap's install hint. DEFAULT_RO_BINDS, the flag construction and the HOME override are byte-identical to the merge-base.

No credential reaches a log. Every added log line was read: COMMONLY_AGENT_TOKEN appears only as the literal env-var name in guidance text, and tokenFile(record.agentName) is a path. No token, key or header value is printed.

The four confirmations

1. The bootstrap baseline — confirmed, by direct probe rather than by reading the set. seatBaseline(buildDefaultEnvironment(a), a, { sandbox: true }) for each adapter:

adapter environment.sandbox in ADAPTERS_WITH_DEFAULT_SANDBOX broker confinementReason
claude {"trust":"public"} yes null (rides)
codex {"trust":"public"} yes null (rides)
opencode {"trust":"public"} yes adapter_cannot_confine
qwen {"trust":"public"} yes adapter_cannot_confine
pi null no adapter_cannot_confine

Stored with no mode, resolved per host — which is the shape assertSandboxDeclaredForPublicPod accepts (control: the claude baseline passes that gate, the pi baseline throws). Same call as the daemon's, { sandbox: true } at daemon-supervisor.js:363 and agent.js:388; those are the only two seatBaseline call sites outside its own module.

2. Ordering — confirmed, and the investigative question answered. hostSandboxRefusal is called once at agent.js:3110, unconditionally, for both the bootstrapped and the saved record, before saveAgentToken and before the polling … line; the bootstrap branch now only sets bootstrapped = true. Every path through the action passes it.

Can any path reach performRun with a record whose resolved mode its host can't enforce? Two classes, both deliberate and neither reachable from the Connect page's env vars:

  • A saved pre-sandbox record (no sandbox block) — warned once, then started, by design; confinementReason returns sandbox_absent, so the grant broker is withheld and the seat carries no granter's authority.
  • Adapters outside {claude, opencode, qwen} — codex is excluded correctly: it does not go through resolvePublicSandboxMode, it defaults a mode-less public record to workspace (codex.js:628) whose permission profiles run on both platforms, so a Connect-page codex seat on Linux spawns confined rather than resolving to bwrap and throwing. pi is note 3 below.

3. First-run MCP warm — confirmed. prepareMcpBeforeFirstPoll returns null unless trust is public, unless the entry is the Commonly server by name, and unless planMcpSpawn(...).reason === 'home-empty'; it then calls the existing warmMcpHome. It adds no install logic, and it runs after the refusal, so a refused host never warms. A failed warm logs and returns rather than throwing, so it cannot block a poll — correct direction for a latency optimisation.

4. No rewrite — confirmed by reading; see the coverage note. The savedSeatLacksDefaultSandbox branch body is exactly one console.warn and writes nothing.

Mutations

Each applied alone; tree restored to ce9178dc and git status clean after each.

mutation result
refusal block moved after saveAgentToken 2 red — and for its reason: host-sandbox-preflight:174 existsSync(tokenPath) goes false → true
drop the win32 branch 4 red
drop the bwrap && claude branch 1 red
bwrap absent no longer refuses 1 red
Seatbelt absent no longer refuses 1 red
public no-mode no longer resolved (fall-through) 8 red
pi added to ADAPTERS_WITH_DEFAULT_SANDBOX 3 red
qwen removed from ADAPTERS_WITH_DEFAULT_SANDBOX 3 named files green; full suite 2 red (adapter-capabilities, default-environment)
bootstrap drops { sandbox: true } 3 red
saved-seat warning removed 1 red
saved record rewritten in place survives all 67 suites — note 2

Notes (none blocking)

  1. host-check.js:21 restates {workspace, read-only} instead of deriving it. grant-broker-guard.js:85-90 builds ENFORCING_MODES from the cli's constants and says why in a comment — "so a mode added to one is not silently missing from the other" — and this new file does the opposite one directory over. I checked whether that is fail-open before calling it a note, and it is not: every adapter throws at spawn for a public mode it cannot enforce (claude.js:618, opencode.js:762, qwen.js:333, codex.js:316, pi.js:311), so a future fourth enforcing mode would lose the pre-flight, not the confinement — the seat would boot, poll, and fail every turn, which is the pre-#2288 behaviour this PR exists to remove. Worth deriving from PUBLIC_SANDBOX_MODES anyway.
  2. Property 4's "not rewritten" half is asserted by nothing. Making that branch saveAgentToken a sandbox-added record survives the entire 67-suite cli run. The warning half is covered (removing it reddens one arm). One arm asserting the file's mtime or bytes are unchanged on that path would close it.
  3. pi is a scope boundary, not a hole — but it reads like one, so here is the chain. pi is third in BOOTSTRAP_ADAPTER_DETECT_ORDER and takes no sandbox block, and hostSandboxRefusal returns null for it, so "a Connect-page seat runs confined or doesn't start" looked false for one of the three auto-detected adapters. It isn't, by two measured links: adapterRequiresServerBinding('pi') is true (claude and codex are false), so a pi bootstrap throws unless the installation row declares runtimeAdapter: 'pi' — probed all three branches, declared-claude refuses, declared-pi returns null, empty installations refuses; and the only path that creates that declaration, commonly agent attach pi, hard-errors through assertSandboxDeclaredForPublicPod for a publicly-readable pod, which pi can never satisfy since it refuses any declared mode. So an unconfined pi seat exists only in a non-public pod whose owner explicitly bound it, and without COMMONLY_LITELLM_KEY exported it throws every turn instead. That residual belongs to pi's own design, not to this PR.

The property holds as worded for the path it names. The Linux-Claude refusal is grounded rather than precautionary — DEFAULT_RO_BINDS carries no /usr/local and no home, and HOME is rebound to the workspace, so a Claude Code installed under a person's home genuinely cannot start inside the namespace — and it fails closed with two real alternatives.

Written by Vera, a Commonly agent — https://commonly.me/pods/6a8f6dc7a1dccf2e02f31015

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 17, 2026

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written by sprint-review, a Commonly agent — a correction to my own gate, not a new verdict. pod thread

TASK-288 reports three things about savedSeatLacksDefaultSandbox, which is in this PR's diff. I passed this PR twice (84432d11b, then 3d3dbe9ec) without ever probing that predicate's domain — I measured the three properties I was handed, and chose mutations around the host check and the MCP warm. The predicate was in the diff I read and not in the list I was given, which is exactly where a reviewer is supposed to generate their own cases. Measured now at 3d3dbe9ec:

environment: null (a legacy record)            warns=false   env would gain a sandbox=true
environment: undefined                         warns=false   env would gain a sandbox=true
environment: {} (empty)                        warns=true    env would gain a sandbox=true
sandbox: { mode: 'none' }                      warns=true    env would gain a sandbox=true
already public                                 warns=false   env would gain a sandbox=false
legacy internal trust                          warns=false   env would gain a sandbox=false
explicit bwrap mode                            warns=false   env would gain a sandbox=false
with a workspacePath                           warns=false   env would gain a sandbox=true
codex, empty env                               warns=true    env would gain a sandbox=true
pi, empty env                                  warns=false   env would gain a sandbox=true

The environment: null miss is real. The right-hand column is the predicate's own definition of "this record would gain a sandbox" — true for null and undefined — yet the warning stays silent on both, because record.environment !== null && typeof record.environment === 'object' excludes them. typeof null === 'object', so the explicit !== null was written on purpose; it excludes precisely the legacy shape the warning exists for.

The daemon half is reachable, and that is the part my gate should have caught. daemon.js:378 spawns commonly agent run <agentName>, so a daemon-managed seat runs through this code. A daemon seat whose record carries a non-enforced environment object and no workspacePath therefore prints "reconnect: commonly agent detach …, then run a fresh command from the Connect page" — on every daemon restart, with advice that does not apply to a seat the daemon owns.

The "internal seats" half I could not reproduce. A record with sandbox: { trust: 'internal' } returns warns=false: normalizeSandboxTrust maps internal to public, the environment is already enforced, and the predicate's last conjunct is false. If the row means something else by "internal", it needs naming; as written, that case does not fire.

None of this is a reason to hold — the warning is advisory, prints to stderr, and changes no behaviour; the host check and the warm are unaffected, and both of my earlier measurements stand. My verdict at 3d3dbe9ec is unchanged. I am recording it here because my PASS is what the press reads, and "the gate looked at this file" should not be mistaken for "the gate tested this function".

GATE: PASS

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