Skip to content

editor-open guard false-positives under Volta: the shim binary itself is named 'capcut' #168

Closed

Description

@realivy0730

Summary

With capcut-cli installed through Volta, every mutating command on a draft inside the managed store (~/Movies/CapCut/User Data/Projects/com.lveditor.draft/...) is refused with refused [editor-open]: CapCut is running, even though CapCut is fully closed.

The fix for #99 replaced substring matching with an exact basename comparison in matchEditorProcesses(). That fixes npx, but Volta's shim binary is itself named capcut, so after lowercasing the two names still collide.

Environment

  • macOS darwin 27.0.0 (arm64)
  • Node v22.23.1
  • capcut-cli 0.32.0 installed via Volta (~/.volta/bin/capcut → volta-shim)
  • CapCut 9.6.0, not running during every step below

Reproduction

$ pgrep -x CapCut ; echo "exit=$?"
exit=1                                   # CapCut is not running

$ ps -axo comm= | grep -ic capcut
0                                        # nothing matches at rest

$ capcut diagnose "<draft>" | jq .editor_running
["CapCut"]

$ capcut remove "<draft>" <segment-id>
{"error":"refused [editor-open]: CapCut is running. Close the editor before writing this managed draft, or pass --force-write if you accept that the app may overwrite the change."}

Sampling ps while any capcut command runs shows what it matched — its own Volta shim process:

$ ( sleep 6 | capcut serve >/dev/null 2>&1 & ) ; sleep 1.5

$ ps -axo pid,comm | grep -i capcut
48878 capcut

$ ps -axo pid,args | grep capcut | grep -v grep
48878 capcut serve
48880 node /Users/<me>/.volta/tools/image/packages/capcut-cli/bin/capcut serve

matchEditorProcesses() lowercases both sides of the comparison, so the shim's capcut matches the editor list's CapCut.

Workaround

Invoking the packaged entry point directly bypasses the shim's process name, and the same write then succeeds:

$ node "$(npm root -g)/capcut-cli/dist/index.js" diagnose "<draft>" | jq .editor_running
[]

Also note the guard only applies to managed store paths (isManagedDraftPath() matches /com.lveditor.draft/). Writes to a /tmp copy of the same draft are unaffected, which makes the false positive easy to miss until you edit a real project.

Suggested fix

  • Skip the current process and its ancestor chain when scanning ps -axo comm= — Volta re-execs, so the shim is an ancestor of the CLI process.
  • Or only treat a match as the editor when the comm path looks like an app bundle (.../CapCut.app/Contents/MacOS/CapCut) rather than a bare capcut.
  • Or compare the POSIX executable name case-sensitively.

Related

Activity

  1. added a commit that references this issue on Nov 7, 2026
    0f58b83
  2. renezander030 commented on Nov 7, 2026

    @renezander030
    Owner

    Thanks for the report, you're right. Under Volta the capcut command is a shim binary with that exact name, and the editor check matched it by name as if CapCut were open. The fix makes the check skip the CLI's own process and its parents, so a real CapCut is still detected, and it will be in the next release. Until then --force-write gets past the check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions