Skip to content

Reject Ranger worktree creation on Windows SSH hosts - #403

Merged
powerfooI merged 2 commits into
mainfrom
fix-ranger-windows-worktree
Oct 13, 2026
Merged

powerfooI merged 2 commits into
mainfrom
fix-ranger-windows-worktree

Conversation

@powerfooI

Copy link
Copy Markdown
Owner

Ranger's create_worktree action called the Unix-only Git root and
worktree hook helpers directly, bypassing the Windows guard that the
ordinary RPC path applies. It now fails before any resource helper or
Herdr call runs; native actions such as create_tab are unchanged.

Fixes #402

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_019MY2e8XVKiGDxDV3mXeV7f

Ranger's create_worktree action called the Unix-only Git root and
worktree hook helpers directly, bypassing the Windows guard that the
ordinary RPC path applies. It now fails before any resource helper or
Herdr call runs; native actions such as create_tab are unchanged.

Fixes #402

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MY2e8XVKiGDxDV3mXeV7f
Address review findings on the Windows worktree fix:

- The connection runtime now makes its Unix-only file, Git,
  agent-history, and worktree-hook helpers throw on Windows hosts, so
  any caller that skips its own check still cannot run Unix shell
  commands there. createWorkspaceWorktree also checks up front.
- Replace the per-caller messages with a shared assertUnixHost helper
  and UnsupportedPlatformError. Ranger tool wrappers surface that error
  to the model verbatim instead of the generic failure, and the
  worktree check now runs after the lease and abort checks.
- workspace_status reports remote_platform "windows", and the history,
  diff, and worktree tool descriptions say they are unavailable there.
- Document the contract in ARCHITECTURE.md and link to it from
  DEPLOYMENT.md with clearer wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MY2e8XVKiGDxDV3mXeV7f
@github-actions github-actions Bot added the enhancement New feature or request label Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

The PR has two commits. The PR description only covers the first one.

  • ce89bce adds the Windows check to Ranger's create_worktree action.
  • fcab9c0 adds four things:
    • On Windows connections, the runtime makes its Unix-only files, worktreeHooks and agentSessions helpers throw. The code is in server/src/connections/unix-only.ts and runtime.ts.
    • Ranger tool wrappers now pass UnsupportedPlatformError to the model instead of replacing it with the generic failure.
    • workspace_status reports remote_platform: "windows".
    • The contract is documented in docs/ARCHITECTURE.md.

Please check in particular whether any code path that can run on Windows still calls the guarded helpers.


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T07:04:06.578666Z fcab9c0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: fcab9c0400

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@powerfooI
powerfooI merged commit 79cac9d into main Oct 13, 2026
5 checks passed
@powerfooI
powerfooI deleted the fix-ranger-windows-worktree branch October 13, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ranger create_worktree bypasses the Windows SSH guard

2 participants