Repository navigation
feat(byo): the page offers the listener only where it runs, and Windows gets PowerShell lines for MCP - #2289
Conversation
…ines for MCP The Connect page now asks which system the commands are for (Mac or Linux, or Windows), defaulting from the browser: - Windows: the listener box says to paste into a WSL 2 (Ubuntu) terminal, not PowerShell, and what WSL needs first (Node, the agent CLI signed in, and bubblewrap for Claude Code). The listener does not run on native Windows (cli 0.1.106 stops with directions). - Windows: the optional Claude Code MCP box is two PowerShell lines, `npm i -g @commonlyai/mcp` then `claude mcp add ... -- cmd /c commonly-mcp`. Measured on windows-latest: the npx form timed out at 30 s on a fresh machine and a direct npx start is not spawnable; this form connected in 0.8 s. zh-CN strings went through the zh-cn-ui-localization two passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG
The browser check of the Windows variant at 1440 showed the PowerShell line split as "common / ly-mcp": `.v2-byo__pre` used word-break: break-all, which breaks anywhere. overflow-wrap: anywhere breaks at spaces first and inside a word only when it cannot fit (the key, a URL), so 390 still never clips. Pinned in v2-layout-invariants. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG
lilyshen0722
left a comment
There was a problem hiding this comment.
Written by sprint-review, a Commonly agent — code gate at a75f65543. pod thread
Base c01b38fd0, merge CLEAN. Tier 1 green at this head (run 38979634278). BASE and RESTORED both 2 suites / 219 passed.
Five mutations
| mutation | failures |
|---|---|
| R1 the browser default ignored (always unix) | 2 — a Windows browser is pointed at WSL for the listener…, Codex on Windows is pointed at WSL without the Claude Code bubblewrap line |
| R3 the Windows needs line reverts to the unix one | 2 — same pair |
| R4 the Windows MCP snippet reverts to the unix one | 1 — the first |
R5 overflow-wrap: anywhere removed from .v2-byo__pre |
1 — the command box breaks inside a word only when the word cannot fit |
R2 isWindowsBrowser stops reading userAgentData |
green, 219 passed |
The browser-check finding is properly pinned: the invariant asserts white-space: pre-wrap and overflow-wrap: anywhere and not word-break: break-all, so the fix cannot regress into the mid-word split it replaced. That is the right shape for a jsdom-invisible defect.
The stated property is not quite what ships
on Mac or Linux the page is unchanged from #2287
It is not: the OS switch row (.v2-byo__os, data-testid="byo-setup-os") renders unconditionally, so a Mac or Linux visitor gets a new line above the needs row that was not there in #2287. That is clearly deliberate — the prose above describes the switch, and a Windows visitor who browses from a Mac needs it — but as a property to check it is false, and the honest form is "on Mac or Linux the commands are unchanged; the page gains the switch."
I checked the commands part and it holds: with a non-Windows UA both the listener snippet and the MCP box are byte-identical to the #2287 behaviour, and R3/R4 confirm the Windows-only strings are reached only through setupOs === 'windows'.
Non-blocking: the userAgentData branch is unexercised
isWindowsBrowser reads nav.userAgentData?.platform || nav.userAgent, and R2 shows that deleting the userAgentData term changes nothing any test sees — the Windows arms stub navigator.userAgent only (:118-119). That matters a little more than a usual coverage gap, because userAgentData.platform is the term that will carry the answer on current Chromium: the UA string there is frozen and still contains Windows NT, so today both terms agree, but the whole point of reading userAgentData first is the day the UA string stops saying it. One arm defining userAgentData: { platform: 'Windows' } with a non-Windows userAgent would pin the branch that is meant to outlive the other.
GATE: PASS
…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
left a comment
There was a problem hiding this comment.
Written by sprint-review, a Commonly agent — code re-gate at d454e6f19, superseding my PASS at a75f65543. pod thread
Tier 1 green at this head (run 38983103554); merge-tree against current main (5c88e4311, which now carries #2290 and #2292) is clean. BASE and RESTORED both 3 suites / 227 passed.
Property 2 cross-tabbed against #2288 itself
"No path shows a listener command where #2288 refuses one" spans two packages with no test between them, so I built both sides: the CLI column is what I measured last turn with spy detectors on hostSandboxRefusal; the page column is listenerRunsOn, a two-line pure predicate.
| os | adapter | page offers a listener | #2288 refuses |
|---|---|---|---|
| mac | claude | yes | no |
| mac | codex | yes | no |
| linux | claude | no | yes |
| linux | codex | yes | no (codex is not in ADAPTER_LABELS) |
| windows | claude | no | yes |
| windows | codex | no | no |
All six agree in the direction that matters: the page never offers a command the CLI would refuse. The single disagreement is windows + codex, where the page is stricter than the CLI — justified independently of the sandbox, since the snippet uses export and PowerShell has none. Worth recording as deliberate rather than as drift, because a future reader comparing the two files will find that cell and wonder.
browserOs behaves as its comment claims — probed with real user agents
I exported it temporarily in a scratch worktree and ran the real function (restored after):
macOS Chrome -> mac Windows Chrome -> windows Linux Firefox X11 -> linux
ChromeOS -> linux Android Chrome -> mac iPhone Safari -> mac
jsdom (darwin host) -> mac jsdom (linux CI host) -> mac
uaData Windows -> windows uaData macOS -> mac uaData Linux -> linux
The !/Android/ guard works, and the case-sensitivity claim holds: a jsdom UA carrying (linux) still reads mac. (Android → mac is the one cell that is merely the least-wrong default; an Android visitor cannot run a listener at all, and the switch is right there.)
Five mutations red, one inconclusive — and the inconclusive one is host-dependent by construction
| mutation | result |
|---|---|
T1 listenerRunsOn true everywhere |
3 red, incl. Linux with Claude Code: no listener command… |
| T2 Linux+Claude treated as available (the exact cell #2288 refuses) | red |
| T3 Mac+Codex loses its listener (a false refusal) | red |
| T5 the MCP box keeps the "command above" body with no command above | red — property 3 |
T6 the needs <p> keeps the available testid when refused |
3 red |
T4 the case-sensitive OS guard replaced by /linux/i |
green, 227 passed |
T4's green is not evidence the guard is unnecessary — it is evidence my host cannot test it. The guard exists so that jsdom's lowercase (linux), which appears only when the suite runs on a Linux host, does not flip the page; this box is darwin, so the mutant and the original agree on every input the suite supplies. On ubuntu-latest the same mutant would flip every default-OS assertion.
So the behaviour is right (my probe shows (linux) → mac through the real function) and the guard is unpinned in a host-independent way. One arm fixes it on any host: set navigator.userAgent to 'Mozilla/5.0 (linux) … jsdom/20.0.0' and assert the page defaults to Mac. Non-blocking, but this is precisely the rule-50 shape — a fixture whose inputs make two behaviours agree — and the comment already names the input that separates them.
GATE: PASS
What changes
The Connect page's result step offers the listener command (the one that makes the agent answer @mentions) only where it runs. Elsewhere it says why and offers what does work.
The step asks which system the commands are for: Mac · Linux · Windows. It defaults from the browser, and the person can switch. Detection matches browser spellings only (
Windows,X11,CrOS,Linux x86_64and similar), so jsdom's lower-case "(linux)" on a CI host doesn't flip the page.Why:
execvp …/.local/bin/claude: No such file or directory, and under Ubuntu's default AppArmorsetting up uid map: Permission denied). fix(cli): a Connect-page seat starts with the daemon's default environment, on a host that can run it #2288 makes the CLI stop there at start.export. WSL is not offered, for the Linux reason above.Windows MCP lines, measured on windows-latest:
This connected in 0.8 s. The other forms fail on Windows:
-- npx -y @commonlyai/mcp: npx is a.cmdshim that can't be spawned directly (ENOENT, and a 30 s timeout);-- cmd /c npx …on a fresh machine: timed out at 30 s while npx was still downloading.Runs 38973754566, 38976026639 and 38976564559.
Tests
V2AgentBYOListenSnippet.test.tsx, "where the listener runs":v2-layout-invariants:.v2-byo__prewraps at spaces (overflow-wrap: anywhere), pinned.zhNumberUnitSpacing:osis declared an opaque placeholder.Browser check (CLAUDE.md rule 9)
Setup: a local Vite build of this branch on 127.0.0.1. Playwright answered every
/apicall with fake data (a placeholder token, nothing reaching production), using a Windows or Linux user agent at 1440 and 390.In all four cases:
An earlier round of this check caught
.v2-byo__presplitting words mid-line ("common / ly-mcp"), fixed and pinned above. This round caught "Optional" and "the command above does" on the MCP box where no command sits above it. Fixed here.Screenshots (signed-in team access):
zh-CN (zh-cn-ui-localization: voice pass, terminology pass, adjudicated)
🤖 Generated with Claude Code
https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG