Skip to content

Remove unnecessary /tmp copy + chmod workaround for cursor-agent#98

Merged
D-K-P merged 2 commits intomainfrom
cursor-cli-demo-improvements
Feb 11, 2026
Merged

Remove unnecessary /tmp copy + chmod workaround for cursor-agent#98
D-K-P merged 2 commits intomainfrom
cursor-cli-demo-improvements

Conversation

@D-K-P
Copy link
Copy Markdown
Member

@D-K-P D-K-P commented Feb 11, 2026

Summary by CodeRabbit

  • Improvements

    • Simplified binary execution by eliminating temporary file workaround and directly using bundled binary for improved native module compatibility.
  • Documentation

    • Updated feature documentation to reflect bundled binary support approach.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 11, 2026

Walkthrough

The changes remove a temporary file workaround from binary execution by replacing the copy-to-/tmp-and-chmod pattern with direct execution of a bundled node binary. The README documentation is updated to reflect this new approach, and the implementation in extensions/cursor-cli.ts is simplified by removing file copying and permission modification operations while maintaining the same runtime behavior for NDJSON event streaming.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: removing the /tmp workaround for binary execution and replacing it with direct bundled node usage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor-cli-demo-improvements

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cursor-cli-demo/extensions/cursor-cli.ts (2)

59-69: ⚠️ Potential issue | 🟡 Minor

Missing existence check for bundledNode.

entryPoint is validated on Line 62 but bundledNode is not. If the bundled node binary is absent, spawn will throw a generic ENOENT which is harder to debug than a descriptive error message like the one for entryPoint.

Proposed fix
   const entryPoint = `${CURSOR_AGENT_DIR}/index.js`;
   const bundledNode = `${CURSOR_AGENT_DIR}/node`;
 
+  if (!existsSync(bundledNode)) {
+    throw new Error(
+      `Bundled node binary not found at ${bundledNode}. Contents: ${existsSync(CURSOR_AGENT_DIR) ? readdirSync(CURSOR_AGENT_DIR).join(", ") : "N/A"}`,
+    );
+  }
+
   if (!existsSync(entryPoint)) {

24-25: ⚠️ Potential issue | 🟡 Minor

Stale comment: still references process.execPath.

Line 24 says "so we can invoke with process.execPath at runtime" but the code now uses the bundled node binary instead. Consider updating to match the new approach.

Proposed fix
-            // Copy the resolved index.js + deps to a fixed path so we can invoke with process.execPath at runtime
+            // Copy the resolved index.js + deps (including bundled node) to a fixed path for runtime invocation

@D-K-P D-K-P merged commit c032450 into main Feb 11, 2026
1 check passed
@D-K-P D-K-P deleted the cursor-cli-demo-improvements branch February 11, 2026 14:02
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.

2 participants