Skip to content

Fix: use Windows-compatible agent launcher commands#2

Open
guuido wants to merge 3 commits into
mainfrom
fix/windows-agent-launch
Open

Fix: use Windows-compatible agent launcher commands#2
guuido wants to merge 3 commits into
mainfrom
fix/windows-agent-launch

Conversation

@guuido

@guuido guuido commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • Fixes terminal agent launcher commands on Windows.
  • Updates Claude, Codex, and Copilot launch buttons to use Windows-compatible environment variable syntax.
  • Keeps existing behavior unchanged on macOS and Linux.

Root Cause

  • The launcher used POSIX inline environment syntax (READO_AGENT=... command).
  • In Windows cmd, that syntax is invalid and gets interpreted as an unknown command.

Changes

  • Added Windows detection in terminal launcher logic.
  • Added a helper to build the correct command per OS:
    • Windows: set "READO_AGENT=<agent>" && <bin>
    • Unix-like: READO_AGENT=<agent> <bin>
  • Updated all three agent launch buttons to use the helper.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed agent launcher behavior so the generated launch commands render and execute correctly on both Windows and non-Windows platforms.
  • New Features
    • Added support for retrieving the default shell for newly spawned PTY sessions, enabling more accurate, shell-aware agent startup from the terminal UI.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@guuido, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 43 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 54f63412-211a-435e-bdd6-7d8d1f67e46c

📥 Commits

Reviewing files that changed from the base of the PR and between 0dc3d01 and 5e2ac55.

📒 Files selected for processing (1)
  • src/components/organisms/TerminalPanel.tsx
📝 Walkthrough

Walkthrough

The backend PTY system now exposes its default shell via a new pty_default_shell Tauri command, which is wrapped in the frontend API as ptyDefaultShell(). TerminalPanel uses this to detect the active shell and OS, then defines agentLaunchCommand(agent, bin) to generate OS-specific command syntax: set "READO_AGENT=..." && bin on Windows or READO_AGENT=... bin elsewhere, with additional PowerShell-specific handling. All three agent launcher buttons (Claude Code, Codex, Copilot) are updated to call this helper instead of using hardcoded command strings.

Changes

Shell-aware agent launch command

Layer / File(s) Summary
Backend PTY shell exposure
src-tauri/src/pty.rs, src-tauri/src/lib.rs
New pty_default_shell() Tauri command exposes the default shell executable path from the PTY subsystem and is registered in the invoke handler.
Frontend PTY shell API wrapper
src/lib/api.ts
New ptyDefaultShell() export wraps the backend command and returns a Promise that resolves to the shell name string.
Terminal shell-aware launch command and launcher buttons
src/components/organisms/TerminalPanel.tsx
Imports ptyDefaultShell and populates a defaultShell state; detects Windows OS and PowerShell via navigator.userAgent and shell name; defines agentLaunchCommand(agent, bin) that emits set "READO_AGENT=..." && bin on Windows or READO_AGENT=... bin elsewhere; updates Claude Code, Codex, and Copilot launcher button onClick handlers to call this helper instead of hardcoded strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A bunny crafts shells with care,
Backend whispers which one's there.
Windows gets set, the rest align,
Now every agent runs just fine!
🐇 ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: implementing Windows-compatible agent launcher commands by detecting the OS and generating platform-specific command syntax.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-agent-launch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/organisms/TerminalPanel.tsx`:
- Around line 95-98: The agentLaunchCommand function generates Windows shell
commands using cmd.exe syntax (set command) which fails on PowerShell since set
is not a recognized PowerShell command. Update the agentLaunchCommand helper to
detect whether the shell is PowerShell or cmd.exe (you can check the COMSPEC
environment variable or shell type), and generate the appropriate syntax: use
set "READO_AGENT=..." && ... for cmd.exe, and use $env:READO_AGENT="..."; ...
for PowerShell. Alternatively, pass the agent name through a method that works
universally across both shells instead of relying on environment variable
syntax.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 70631024-de18-49cd-a99d-743a5cf1c4b8

📥 Commits

Reviewing files that changed from the base of the PR and between eb44029 and 022547d.

📒 Files selected for processing (1)
  • src/components/organisms/TerminalPanel.tsx

Comment thread src/components/organisms/TerminalPanel.tsx
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.

1 participant