Skip to content

fix: self-heal node-pty spawn-helper permissions at runtime#3

Open
samwei12 wants to merge 1 commit intocloudcli-ai:mainfrom
samwei12:fix/runtime-spawn-helper-permissions
Open

fix: self-heal node-pty spawn-helper permissions at runtime#3
samwei12 wants to merge 1 commit intocloudcli-ai:mainfrom
samwei12:fix/runtime-spawn-helper-permissions

Conversation

@samwei12
Copy link
Copy Markdown

Summary

Fixes the macOS case where the official terminal plugin installs successfully but new terminal sessions disconnect immediately because node-pty cannot spawn its helper.

Closes #1.

Root cause

CloudCLI intentionally installs plugins with npm install --ignore-scripts, so plugin postinstall hooks are not available for fixing node-pty packaging issues.

On macOS, node-pty's spawn-helper can exist without execute permission. The plugin websocket still comes up, but pty.spawn(...) then fails and the UI drops into an immediate disconnect state.

What changed

  • added findModuleRoot() so runtime self-heal resolves the same node-pty copy that the plugin actually loads
  • added darwin-only ensureSpawnHelperExecutable() before pty.spawn(...)
  • limit the fix to the current architecture's helper
  • only add the minimal owner execute bit needed

Verification

  • npm install --ignore-scripts
  • npm run build
  • manually remove execute permission from the current arch spawn-helper
  • confirm PTY spawn succeeds after runtime self-heal on macOS arm64

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal plugin disconnects immediately on macOS after install

1 participant