Skip to content

feat(byo): the page offers the listener only where it runs, and Windows gets PowerShell lines for MCP - #2289

Merged
lilyshen0722 merged 3 commits into
mainfrom
lily/byo-windows-lines
Oct 17, 2026
Merged

lilyshen0722 merged 3 commits into
mainfrom
lily/byo-windows-lines

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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_64 and similar), so jsdom's lower-case "(linux)" on a CI host doesn't flip the page.

listener command Claude Code MCP box
Mac, either CLI shown (unchanged) bash, optional
Linux + Codex shown n/a (Codex)
Linux + Claude Code a line says why, pointing to the MCP command and "Run it here" bash, titled as the way in
Windows + Claude Code the same two PowerShell lines
Windows + Codex a line pointing to "Run it here" or another machine n/a

Why:

Windows MCP lines, measured on windows-latest:

npm i -g @commonlyai/mcp
claude mcp add commonly -e COMMONLY_API_URL=… -e COMMONLY_AGENT_TOKEN=… -- cmd /c commonly-mcp

This connected in 0.8 s. The other forms fail on Windows:

  • -- npx -y @commonlyai/mcp: npx is a .cmd shim 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":
    • Mac starts on Mac with the listener;
    • Windows: no listener, the reason, the PowerShell lines, and the box without "Optional" or "command above";
    • Linux + Claude: no listener, the bash MCP command; switching to Codex brings the listener back;
    • Codex on Windows;
    • the switch overrides the browser.
  • v2-layout-invariants: .v2-byo__pre wraps at spaces (overflow-wrap: anywhere), pinned.
  • zhNumberUnitSpacing: os is declared an opaque placeholder.
  • All BYO, i18n and layout suites pass: 280/280.

Browser check (CLAUDE.md rule 9)

Setup: a local Vite build of this branch on 127.0.0.1. Playwright answered every /api call with fake data (a placeholder token, nothing reaching production), using a Windows or Linux user agent at 1440 and 390.

In all four cases:

  • no horizontal overflow on the page or in any command box;
  • the right system is pressed and the listener command is absent;
  • the MCP box shows PowerShell on Windows and bash on Linux.

An earlier round of this check caught .v2-byo__pre splitting 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)

key shipped note
listen.osLabel / osMac / osLinux / osWindows 你的系统: / Mac / Linux / Windows Both passes: 系统, not 电脑, which is already the machine picker
listen.unavailableClaude Claude Code 在 {{os}} 上暂时不能回复 @提及:Commonly 要把它放进沙箱里运行,而 Commonly 用的沙箱在 {{os}} 上还做不到。你可以用下面的命令把 Commonly 的工具接进自己的 Claude Code 会话,或者选择“在这里运行”,改用托管智能体。 Voice: rhythm, and no full-width mark after a product name. Terminology: "Commonly 用的沙箱", because "Windows 沙盒" is a real product
listen.unavailableCodex Codex CLI 在 Windows 上暂时不能回复 @提及。你可以选择“在这里运行”,改用托管智能体;也可以换到 Mac 或 Linux 机器上运行这条命令。 Voice: a semicolon splits the two options
snippets.claudeCodeBodyWindows 两行都粘贴到 PowerShell 里运行。这样你在这台电脑上的 Claude Code 会话就能用上 Commonly 的工具。 Earlier adjudicated string, minus its "command above" sentence
snippets.claudeCodeBodyOwn / claudeCodeMain 为你自己的 Claude Code 会话加上 Commonly 的工具。 / 让 Claude Code 在你自己的会话里使用这个 Pod Substrings of existing reviewed strings

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wkz5axAzCvoLEFkZ5KtkKG

lilyshen0722 and others added 2 commits October 16, 2026 16:02
…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 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 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 lilyshen0722 changed the title feat(byo): Windows visitors get WSL for the listener and PowerShell lines for MCP feat(byo): the page offers the listener only where it runs, and Windows gets PowerShell lines for MCP Oct 16, 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 — 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

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