Repository navigation
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@KassaSana I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@KassaSana I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Fixes Windows cmd.exe quoting for CLI commands by using real quotes on the command token while keeping caret-escaping for arguments, verified by real cmd.exe spawn tests and CI. The fix is focused and clearly beneficial.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Fixes Windows cmd.exe quoting for CLI command paths by using real quotes on the command token while keeping caret-escaping for arguments, with real cmd.exe spawn tests and a Windows CI job. Bounded, test-verified bug fix.
Re-trigger cubic
|
@developersdigest could you approve the workflow runs when you get a chance? They're waiting on first-time contributor approval, and this PR adds a Windows job that exercises the fix for #188 against a real cmd.exe. Thanks! |
runClientCommand() launches .cmd shims such as npx.cmd through `cmd.exe /d /s /c`, and escaped the resolved program path with the same escapeCmdArg() used for arguments. That produces ^"C:\Program Files\...^". For arguments this works, because cmd.exe strips the carets and passes the quotes on to the program. The program path, though, is parsed by cmd.exe itself, where ^" is a literal character rather than a quote, so the path splits at the first space: '"C:\Program' is not recognized as an internal or external command This broke `firecrawl setup mcp`, skills installs and every other setup step that runs npx whenever Node lives under C:\Program Files, which is the default install location. Quote the program path with plain quotes (Windows paths cannot contain `"`) and leave argument escaping unchanged. Escaping the arguments with unescaped outer quotes as well would stop the carets from being consumed, so an argument like `https://host/mcp?a=1&b=2` would arrive as `a=1^&b=2`. The existing win32 test mocked child_process and asserted the ^"...^" form, so it could not see the failure. Update that assertion, and add a win32-only test that spawns a real cmd.exe with a .cmd shim under "Program Files (x86)" and checks the argv it receives. Fixes firecrawl#188
cmd.exe expands %VAR% (and !VAR! under delayed expansion) even inside double quotes, where a caret is a literal character. With the command path now in plain quotes, a launcher under a directory such as `dir%USERNAME%x` was rewritten to the variable's value and failed with "The system cannot find the path specified" (the previous caret-escaped form handled this, but only for paths without spaces). Close the quotes around each % and ! and caret-escape it outside them, e.g. "C:\a"^%"X"^%"b\npx.cmd", so the path is passed through literally whether or not it contains spaces. Extend the real cmd.exe test to cover %USERNAME% in the path, with and without spaces.
setup-windows-spawn.test.ts only runs on win32, and the main test job runs on ubuntu-latest, so those tests were always skipped in CI. Add a windows-latest job that runs just that file, reusing the existing Node and pnpm setup steps. It targets the one file rather than adding Windows to the main job, because the full suite has pre-existing Windows-only failures (path assumptions in setup, credentials and web-defaults tests) that are identical on main.
5fcdca5 to
8ef1c4d
Compare
|
@erikengervall Rebased onto current main. Full suite passes locally (872 passed, the 3 real-cmd.exe tests skip off Windows). This adds a |
|
Following up on this. It's rebased on current main and the review threads are resolved. The new test-windows-spawn job still needs workflow approval to run against a real cmd.exe. Could a maintainer approve the runs and review when you get a chance? Thanks! |
Match the other jobs: pin actions to the same SHAs, read-only contents permission, and persist-credentials: false on checkout. Drop the pnpm version input. pnpm/action-setup throws when it differs from packageManager in package.json (pnpm@10.34.7), so the job would fail before running any test.
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Fixes Windows command-path quoting and adds real cmd.exe regression coverage in CI. The change is narrowly scoped to setup command execution, with tests covering paths and arguments that previously failed.
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Re-trigger cubic

On Windows,
firecrawl setup mcpand every other setup step that runsnpxfail when Node is installed underC:\Program Files\, the default location:Fixes #188
Cause
runClientCommand()starts.cmdshims throughcmd.exe /d /s /cand escapes the program path withescapeCmdArg(), giving^"C:\Program Files\nodejs\npx.cmd^". That escaping is right for arguments, because cmd.exe strips the carets and the program's C runtime sees the quotes. cmd.exe parses the program path itself. There^"is a literal character, so cmd.exe splits the path at the first space.Changes
quoteCmdCommand()and use it for the program path only. It wraps the path in plain quotes. cmd.exe still expands%VAR%and!VAR!inside quotes, soquoteCmdCommand()moves each%and!outside the quotes and caret-escapes it. Argument escaping is unchanged.runClientCommandso tests can call it.setup.test.ts. It asserted the broken^"…^"form, so it passed while the real spawn failed.setup-windows-spawn.test.ts. It spawns a realcmd.exewith a.cmdshim underProgram Files (x86)and checks that arguments arrive unchanged, including&and${FIRECRAWL_API_KEY}. It also covers paths containing%USERNAME%.test-windows-spawnCI job onwindows-latestthat runs that one file on pull requests. The maintestjob runs on Linux and skips those tests. The new job uses the same pinned action SHAs, read-onlycontentspermission andpersist-credentials: falseas the other jobs, and takes the pnpm version frompackageManager.This differs from the patch suggested in #188, which changed
escapeCmdArgfor every argument. With unescaped outer quotes cmd.exe stops stripping the carets, sohttps://x.dev/mcp?a=1&b=2would arrive asa=1^&b=2. Thanks to @matheusjosedesouzabispo-blip for pointing toescapeCmdArg.#187 moves
runClientCommandtosrc/utils/run-client-command.tswith the sameescapeCmdArg(resolved)line. If #187 merges first, I'll rebase and apply the same change there.Testing
Windows 11, Node 26, pnpm 10.12.1:
firecrawl setup mcp --project --agent claude-code -y --keylessin a temporary directory. Published 1.24.4 fails with the error above. This branch printsDone!and writes.mcp.json.mainand on this branch. All 28 are in unrelated tests whose path assumptions don't hold on Windows. This PR adds none.Linux, Node 22:
mainhas 619 passing. This branch has 619 passing plus 3 skipped win32-only tests.pnpm type-check,pnpm buildand Prettier pass.