-
Notifications
You must be signed in to change notification settings - Fork 212
Description
Environment
- OS: Windows 10/11 (Git Bash)
- Node.js: v22.18.0 (via NVM for Windows / nvm4w)
- OpenCLI: v0.9.0
- Antigravity: v1.107.0 (Electron 39.2.3 / Chrome 142)
- @playwright/mcp: globally installed
Summary
When using opencli antigravity commands on Windows with NVM, I encountered 3 related issues that prevent the CDP adapter from working out of the box. All three are specific to the Windows + NVM environment.
Bug 1: findMcpServerPath() fails to detect globally installed @playwright/mcp on Windows + NVM
Steps to reproduce:
- Install Node via NVM for Windows (
nvm4w) npm install -g @playwright/mcpexport OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9224"opencli antigravity status -v
Expected: OpenCLI finds the globally installed MCP server
Actual: Logs Playwright MCP not found locally; bootstrapping via npx @playwright/mcp@latest, then fails
Root cause (discover.js):
The global path check uses path.join(nodePrefix, 'lib', 'node_modules', ...), but on Windows with NVM the actual path is:
C:/Users/<user>/AppData/Local/nvm/v22.18.0/node_modules/@playwright/mcp/cli.js
There is no lib/ directory in the NVM prefix on Windows. The npm root -g fallback also fails because the 2>/dev/null redirect does not work properly in Windows shell context.
Workaround: Manually set OPENCLI_MCP_SERVER_PATH:
export OPENCLI_MCP_SERVER_PATH="C:/Users/<user>/AppData/Local/nvm/v22.18.0/node_modules/@playwright/mcp/cli.js"Bug 2: npx fallback spawn fails on Windows with "系统找不到指定的路径"
When findMcpServerPath() returns null, the fallback buildMcpLaunchSpec() tries to spawn npx directly:
{ command: 'npx', args: ['-y', '@playwright/mcp@latest', ...] }On Windows (Git Bash), this produces:
系统找不到指定的路径。 (The system cannot find the path specified.)
Error: Playwright MCP process exited before the browser connection was established.
Likely cause: spawn('npx', ...) on Windows needs either shell: true or the explicit npx.cmd extension.
Bug 3: Multi-window Antigravity connects to wrong page (Launchpad)
When Antigravity has multiple windows open (e.g., several projects + Launchpad), the CDP connection defaults to the Launchpad page (workbench-jetski-agent.html) which does not have the agentSidePanelInputBox element.
Steps to reproduce:
- Launch Antigravity with
--remote-debugging-port=9224 - Open multiple project windows
opencli antigravity send "hello"
Expected: Connects to a workbench page that has the chat panel
Actual: Connects to Launchpad → Error: Could not find antigravity.agentSidePanelInputBox
Diagnostic output (curl http://127.0.0.1:9224/json/list) shows multiple pages available, but Playwright MCP selects the wrong default target.
Suggestion: The Antigravity adapter could filter pages by checking:
- URL contains
workbench.htmlbut NOTjetski-agent - Or verify
agentSidePanelInputBoxexists before proceeding
My Workaround
I wrote a direct CDP script (cdp_antigravity.mjs) that:
- Scans all CDP pages via
/json/list - Checks each workbench page for
agentSidePanelInputBox - Connects to the first page that has the chat panel
This successfully sends/reads messages. Happy to contribute a PR if helpful.