Skip to content

fix(agent-hooks): stop rewriting typed Prime commands - #13906

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/remove-prime-shell-interception
Aug 12, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/remove-prime-shell-interception

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • remove the shell-level prime-agent wrapper and its automatic --extension injection
  • preserve user-provided Prime argv unchanged
  • keep explicit local Prime launches on normal managed extension discovery
  • remove the WSL-only host extension bridge; Prime status hooks remain unavailable there without native discovery support
  • retain existing OMP and shared WSL relay behavior

Validation

  • focused Vitest coverage: 717 tests passed (478 PTY tests passed on isolated rerun after one unrelated teardown timeout)
  • pnpm typecheck
  • staged-file lint and formatting hooks
  • git diff --check

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c2d8cb80-1631-47ad-bcca-e0559146a06f

📥 Commits

Reviewing files that changed from the base of the PR and between 91959eb and 33f3e90.

📒 Files selected for processing (1)
  • src/main/pty/wsl-orca-env.test.ts

📝 Walkthrough

Walkthrough

The PR removes Prime Agent WSL status bridging and related environment propagation. PTY launches now prepare Prime Agent state only for explicit non-WSL launches. Generated Bash and Zsh shell-ready files use the OMP wrapper and exclude Prime Agent wrapper content. The titlebar extension service retains an OMP-specific fallback directory and removes Prime Agent status-only environment construction. WSL environment passthrough no longer includes the Prime status-extension variable. Relay instance-key fallback logic remains inside relay initialization.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main changes and validation, but it omits most required template sections, including the linked issue, visual proof, testing checklist, review, and author details. Complete the required template sections and add the linked issue, visual-proof status, testing platforms, review considerations, checklist state, and author information.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title describes a real change by stating that typed Prime commands are no longer rewritten, but it does not mention the broader wrapper and WSL bridge removal.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (1)
src/main/pty/wsl-orca-env.test.ts (1)

51-51: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Keep an inherited Prime status-extension value in the fixture.

The test no longer provides ORCA_PRIME_AGENT_STATUS_EXTENSION. Line 71 therefore does not prove that addOrcaWslInteropEnv excludes an inherited value from WSLENV. Restore a stale fixture value so this contract is tested.

Proposed test adjustment
       ORCA_OMP_STATUS_EXTENSION: 'C:\\Users\\jin\\.omp\\agent\\extensions\\orca-agent-status.ts',
+      ORCA_PRIME_AGENT_STATUS_EXTENSION: 'C:\\stale\\orca-agent-status.ts',
       ORCA_PANE_KEY: 'tab-1:leaf-1',

Also applies to: 71-71


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 525f068c-802b-4795-badd-c0786f0f6aff

📥 Commits

Reviewing files that changed from the base of the PR and between 96c17b4 and 91959eb.

📒 Files selected for processing (15)
  • src/main/agent-hooks/wsl-hook-relay-manager.test.ts
  • src/main/agent-hooks/wsl-hook-relay-manager.ts
  • src/main/daemon/shell-ready.test.ts
  • src/main/daemon/shell-ready.ts
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/pi/titlebar-extension-service.test.ts
  • src/main/pi/titlebar-extension-service.ts
  • src/main/providers/local-pty-shell-ready.test.ts
  • src/main/providers/local-pty-shell-ready.ts
  • src/main/providers/windows-shell-args.test.ts
  • src/main/pty/prime-agent-shell-wrapper.test.ts
  • src/main/pty/prime-agent-shell-wrapper.ts
  • src/main/pty/wsl-orca-env.test.ts
  • src/main/pty/wsl-orca-env.ts
💤 Files with no reviewable changes (7)
  • src/main/pty/prime-agent-shell-wrapper.test.ts
  • src/main/pty/wsl-orca-env.ts
  • src/main/pty/prime-agent-shell-wrapper.ts
  • src/main/agent-hooks/wsl-hook-relay-manager.test.ts
  • src/main/providers/local-pty-shell-ready.ts
  • src/main/daemon/shell-ready.ts
  • src/main/pi/titlebar-extension-service.test.ts

@OrcaWin

OrcaWin commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Windows Electron QA — PR #13906 @ 33f3e9072b24d0c400c87f9a1e0473992c107735

Identity (CDP): Orca: OrcaWin/pr-13906-prime-argv · worktree C:\Users\neil\orca\workspaces\orca\pr-13906-prime-argv · CDP 9333 · playwright-cli only (no Computer Use).

What each screenshot proves

04-final-native-wsl-prime-argv.png — Full-context rendered Orca terminal after:

  1. Native host PTY: disposable prime-agent.cmd stub invoked with hello --flag value --prompt typed-unchanged → argv reached stub unchanged, no --extension.
  2. Host env: ORCA_PRIME_AGENT_STATUS_EXTENSION empty/unset; ORCA_OMP_STATUS_EXTENSION still set to OMP status extension path (OMP preserved).
  3. WSL via wsl -d Ubuntu -- /tmp/orca-prime-argv-qa/run-qa.sh from that same terminal: guest stub argv unchanged (no --extension); HAS_PRIME_FUNC=no / HAS_ORCA_PRIME_FUNC=no (no prime shell wrapper). Nested wsl is not an Orca-managed WSL PTY, so guest WSLENV/OMP interop was not exercised on this path (host OMP env still intact).

03-prime-stub-argv.png — Earlier native stub surface in the rendered app terminal (same no-wrap argv path).

01-launch.png — App up on intended worktree before the terminal scenario.

Gaps (explicit)

  • Image upload used Linux gh-attach under WSL with host GH_TOKEN (Windows gh image lacked browser session; Windows gh-attach binary N/A).
  • Fresh TEMP userData hit host-wide fsync EPERM on profile-index write (unrelated to this PR); isolated LocalAppData profile used for CDP attach. No product code changes. No merge.

Screenshots

PR #13906 Windows Electron prime-argv QA @ 33f3e90

04-final-native-wsl-prime-argv.png 03-prime-stub-argv.png
04-final-native-wsl-prime-argv.png 03-prime-stub-argv.png
01-launch.png
01-launch.png

@brennanb2025
brennanb2025 merged commit 4b9fb46 into main Aug 12, 2026
92 of 94 checks passed
AmethystLiang pushed a commit that referenced this pull request Aug 13, 2026
* fix(agent-hooks): preserve typed Prime commands

* test(wsl): enforce Prime bridge exclusion

---------

Co-authored-by: OrcaWin <[email protected]>
(cherry picked from commit 4b9fb46)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(agent-hooks): preserve typed Prime commands

* test(wsl): enforce Prime bridge exclusion

---------

Co-authored-by: OrcaWin <[email protected]>
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