Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): quote copied native provider update commands #9856

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/9856/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Native updater paths preserved by #9850 were copied from Settings without shell quoting. A path containing spaces worked with Update now, but Copy update command produced a command that failed in the terminal.

Quote the executable in the copied command using the environment's platform. POSIX paths use single quotes; Windows uses the existing PowerShell default and its call operator when quoting is needed. The executable and argument array used by one-click updates stay unchanged. Package-manager command strings stay unchanged too.

This follows up #9850. The broader installation-discovery report #6115 remains open.

Before and after

The tests create disposable executable stubs, obtain the exact versionAdvisory.updateCommand copied by Settings, and run that string through /bin/sh with an empty PATH. No provider is installed or updated.

Native pathBeforeAfter
Plain pathExit 0, upgradeExit 0, upgrade
Path with spacesExit 127, truncated executable not foundExit 0, upgrade
Path with apostrophes and $Exit 127Exit 0, upgrade

The failure was reproduced on 2d5464a. The original fix was based on 896fe82. It is now refreshed onto ce4712d5, including the upstream CI mirror repair; no additional workflow changes were made. The changed behavior is copied command text, so executable before/after evidence is provided instead of layout screenshots.

Verification

  • 42 focused maintenance, runner, and Cursor driver tests pass, including all three shell executions, PowerShell path formatting, apostrophe escaping, and injected environment-platform handling.
  • A disabled Cursor driver fixture reproduces the missing injected-platform handoff before its fix and passes afterward. It rejects any process spawn or HTTP request.
  • Server typecheck, targeted lint, formatting, and git diff --check pass.
  • Actual shell execution was tested on Linux. PowerShell formatting is covered by fixtures; native Windows execution was not available.
  • Web and desktop copy the server-provided advisory string. Formatting follows the environment platform, not the connecting client's OS. No mobile UI or wire schema changes.

Review limitation

The Effect Service Conventions check concluded NEUTRAL, not success. It flags the synchronous helpers' ambient-platform fallback. Current production drivers acquire and forward the environment platform; six focused Windows/platform controls pass on this head, including the actual disabled Cursor driver. The orchestrator reviewed the concern and deferred a broader required-parameter refactor as nonblocking for this scope. Future synchronous native callers must supply their intended platform explicitly. All executed CI tests pass; the neutral check is not described as green.

GPT 6 Astra via Codex in T3 Code.


Note

Low Risk Changes only the copied command string for provider maintenance; one-click updates and package-manager commands are untouched, with a minor requirement that effectful resolution paths provide HostProcessPlatform.

Overview Copy update command for native provider updaters now quotes the executable when the path needs shell escaping, so pasted commands work in terminals (paths with spaces, quotes, or $ no longer break on POSIX; Windows gets PowerShell-style & '...' with doubled apostrophes).

makeProviderMaintenanceCapabilities builds the display command via new quoteUpdateExecutable using an optional platform on maintenance resolution options. resolveProviderMaintenanceCapabilitiesEffect supplies HostProcessPlatform when callers omit it, and native/Cursor resolvers forward platform so formatting matches the server host—not the UI client. Update now still uses unquoted executable + args; npm/brew-style command strings are unchanged.

Tests add POSIX shell runs of the copied advisory string, Windows command fixtures, platform injection through the effect resolver, and a disabled CursorDriver case for a spaced Windows binary path.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e589282ab156ff69b4f523343dc88cce99d9884a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Quote copied native provider update commands for target platform

  • Adds quoteUpdateExecutable to providerMaintenance.ts, which quotes executable paths containing spaces or shell-significant characters using POSIX single-quote escaping or PowerShell call-operator syntax with doubled apostrophes
  • Introduces an optional platform field on ProviderMaintenanceCapabilityResolutionOptions and threads it through resolveProviderMaintenanceCapabilitiesEffect, resolvePackageManagedProviderMaintenance, and makeNativeProviderMaintenanceCapabilities so update descriptors format commands for the requested platform instead of always joining the raw path with arguments
  • Adds tests covering Windows paths with spaces and apostrophes, POSIX paths with shell-significant characters, and platform injection through the effectful resolver in providerMaintenance.test.ts and CursorDriver.test.ts
  • Risk: resolveProviderMaintenanceCapabilitiesEffect now requires HostProcessPlatform when the caller does not supply a platform explicitly; callers that previously relied on the resolver without this service available will fail
Macroscope summarized e589282.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 0471f19

      Macroscope's review found this PR approvable — This is a narrowly scoped provider-update command formatting fix with platform-aware quoting and focused coverage for POSIX and PowerShell paths. Existing update execution inputs and product defaults remain unchanged, keeping the production blast radius small.

      No code changes detected at e589282. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.5 KiB13.5 KiB+6 B (+0.0%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB+3 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.5 KiB+3 B (+0.0%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages880 (0.0%)21✅
      ClaudeTotal thread wire13.8 KiB13.8 KiB+7 B (+0.0%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.0 KiB+7 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.7 KiB6.7 KiB0 B (0.0%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded59.3 KiB59.3 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages10100 (0.0%)21✅

      Baseline: ce4712d · PR result: e589282 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.8 KiB
      • Claude decoded thread snapshot: 114.5 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. Current-head validation is blocked by CI infrastructure, not a passing run. On 0471f19, Check and Test exhausted their 10-minute limit downloading Ubuntu packages. Both logs show repeated HTTP connection failures. One retry reached the same result on September 5, 2026 UTC; no workflow or check was bypassed.

      The 42 focused tests, targeted lint, server typecheck, all three server CI shards, and current-head code reviews pass. The PR remains unmerged until the remaining CI gates pass.

    5. juliusmarminge reviewed

      Root merge judgment at e589282: reviewed the complete four-file change, 42-test before/after evidence, fresh platform rerun, current checks and complete review threads. CI and correctness reviews pass. Effect Service Conventions is NEUTRAL, not green: I accept its documented nonblocking ambient-fallback concern for this narrow fix because current native and Cursor paths receive the environment platform explicitly, while static package-manager names quote identically on both platforms. No update action or argv changes, API expansion, policy change or check bypass is needed. The larger report #6115 remains open for other discovery variants. GPT 6 Astra via Codex in T3 Code.

    6. juliusmarminge merged thisd28077e

    7. juliusmarminge closed this

Sign in to join this conversation.