Repository navigation
Conversation
…s to use it - Introduced escapeArgForWindowsShell function to handle argument escaping for Windows shell. - Updated ClaudeTextGeneration and CodexTextGeneration layers to utilize the new utility for escaping JSON strings and configuration arguments. - Added unit tests for escapeArgForWindowsShell to ensure correct functionality across platforms.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ckpointDiffQuery.ts (pingdotgg#1622) Co-authored-by: codex <codex@users.noreply.github.com>
…ckpointStore.ts (pingdotgg#1623) Co-authored-by: codex <codex@users.noreply.github.com>
…eration.ts (pingdotgg#1625) Co-authored-by: codex <codex@users.noreply.github.com>
pingdotgg#1632) Co-authored-by: codex <codex@users.noreply.github.com>
…ration.ts (pingdotgg#1624) Co-authored-by: codex <codex@users.noreply.github.com>
…csService.ts (pingdotgg#1642) Co-authored-by: codex <codex@users.noreply.github.com>
…vider.ts (pingdotgg#1635) Co-authored-by: codex <codex@users.noreply.github.com>
…ovider.ts (pingdotgg#1634) Co-authored-by: codex <codex@users.noreply.github.com>
…AdapterRegistry.ts (pingdotgg#1637) Co-authored-by: codex <codex@users.noreply.github.com>
…erProvider.ts (pingdotgg#1640) Co-authored-by: codex <codex@users.noreply.github.com>
…e.ts (pingdotgg#1631) Co-authored-by: codex <codex@users.noreply.github.com>
…sonLogger.ts (pingdotgg#1636) Co-authored-by: codex <codex@users.noreply.github.com>
…Registry.ts (pingdotgg#1638) Co-authored-by: codex <codex@users.noreply.github.com>
…Service.ts (pingdotgg#1639) Co-authored-by: codex <codex@users.noreply.github.com>
…viderCommandReactor.ts (pingdotgg#1629) Co-authored-by: codex <codex@users.noreply.github.com>
…ient.ts (pingdotgg#1633) Co-authored-by: codex <codex@users.noreply.github.com>
…s to use it - Introduced escapeArgForWindowsShell function to handle argument escaping for Windows shell. - Updated ClaudeTextGeneration and CodexTextGeneration layers to utilize the new utility for escaping JSON strings and configuration arguments. - Added unit tests for escapeArgForWindowsShell to ensure correct functionality across platforms.
Resolve conflicts keeping Effect.fn structure from upstream with escapeArgForWindowsShell applied to CLI arguments.
|
Closing — this has already been addressed upstream. |
ApprovabilityVerdict: Needs human review This PR mixes three concerns: a small Windows shell escaping bug fix, a large mechanical refactor (Effect.gen → Effect.fn pattern migration) touching 15+ files including critical provider and persistence layers, and a new 'Trae' editor feature. While the refactor appears behavioral-no-op (adds tracing span names), the breadth of changes across unfamiliar code by a newer contributor warrants human verification. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Added a centralized
escapeArgForWindowsShellutility inpackages/shared/src/shell.tsthat escapes double-quote characters ("→\") in command-line arguments when spawning processes withshell: trueon Windows.Applied it to two affected call sites:
ClaudeTextGeneration.ts—--settingsand--json-schemaarguments (JSON strings)CodexTextGeneration.ts—--configarguments (key="value"pairs)Why
On Windows, every
ChildProcess.make/spawncall usesshell: trueso thatcmd.execan resolve.cmdshims in PATH. The child process's C runtime (MSVCRT) parses the raw command-line string intoargvand treats unescaped"as argument-quoting delimiters — consuming them instead of passing them through.This means a JSON argument like
{"fastMode":true}arrives at the CLI as{fastMode:true}(quotes stripped), producing:TextGenerationError: Claude CLI command failed: Error: Invalid JSON provided to --settingsThe same class of issue affects the Codex
--configarguments where values are wrapped in quotes (e.g.model_reasoning_effort="high"→model_reasoning_effort=high).Escaping each
"as\"makes MSVCRT treat them as literal quote characters, preserving the original value.Checklist
Note
Medium Risk
Medium risk because it changes how CLI command arguments are constructed for text generation, which could affect request formatting across platforms, though the change is narrow and covered by new unit tests.
Overview
Prevents Windows
shell: truespawning from stripping double quotes in CLI args by introducingescapeArgForWindowsShellinpackages/shared/src/shell.ts.Applies the escaping to Claude
--json-schema/--settingsand Codex--configarguments, and adds unit tests validating Windows vs non-Windows behavior.Written by Cursor Bugbot for commit ac4bbd0. Configure here.
Note
Fix Windows shell escaping for CLI arguments containing double quotes
escapeArgForWindowsShellinpackages/shared/src/shell.tsthat replaces"with\"onwin32and is a no-op on other platforms.--json-schemaand--settingsargs in the Claude CLI runner and to--configvalues in the Codex CLI runner on Windows.id: "trae") in theEDITORSconstant, the Open In picker, and the server-side editor resolution and tests.Effect.genfunctions with namedEffect.fn("...")for better tracing; no logic changes.Macroscope summarized 5d04c90.