You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix copying from Codex started manually in remote shells - #34715
Typing codex in a remote Orca shell could copy text only on the server. Newly created remote shells now make that manual launch send clipboard text back to the viewer, just like Codex launched from Orca's agent controls.
What Changed
Pass the existing remote-viewer intent into shell startup and apply the Codex clipboard environment only inside its existing Bash, Zsh, Fish, and PowerShell wrappers. Keep the parent shell and inherited SSH values intact. Forward the intent across WSL using the existing environment channel.
Route native shell-startup and daemon PTY tests through the established Node pool; unchanged Bun PTY empty-output failures also reproduce on the original baseline.
Why
The existing clipboard setup only covered launches that already identified the agent as Codex. Manual shell launches missed it. This extends the existing path without changing selection or mouse behavior.
Linked Issue
Remote-terminal report supplied for this work. Related existing setup: #34102.
Visual Proof
Before: manual remote launch has no clipboard marker and the isolated viewer clipboard sink stays empty.
After: the same probe emits the expected text through the paired connection.
Real Codex 0.165.0 /copy, using an isolated saved response and no inference, delivered REMOTE_CODEX_COPY_PROOF through production OSC52 parsing and clipboard:writeTerminalText.
Testing
Independently reviewed and exercised by sub-agents.
Thirty before/after Bash, Zsh, and Fish probes; PowerShell 7 container probes covering inherited SSH/TTY values, nonzero exit, and exception cleanup.
Fourteen real local-PTY launch tests passed, including three custom-argument regressions proven red before the correction. An independent reviewer passed 22 additional local/daemon launch controls covering custom rc paths, no-rc flags, explicit empty arguments, default clipboard wrappers, and controlled agent launches.
Hidden Electron with a real paired serve host: baseline/fixed wrapper probes and real Codex /copy; captured the final viewer clipboard write in an isolated sink. The real CLI also performed its native macOS host copy; that put the test marker on the host clipboard, so the sink did not isolate that native side effect.
Final head 6fb19ed: all 65 reported CI checks settled successfully, including all unit shards, shell contracts, E2E, packaging, native-platform persistence, all WSL variants, CodeRabbit, and JavaScript/TypeScript and Swift CodeQL.
Six independent Ubuntu 24.04 controls reproduced the system startup banner and verified exact profile-result extraction still rejects wrong startup, login mode, and missing markers.
Independent final-head Bash, Zsh, and Fish probes saved the wrapped call status immediately: all preserved nonzero status 3 before and after the bare control call, while keeping the remote marker out of the parent shell. This directly covers the nonblocking exit-status fixture suggestion from review.
Initial required local ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: 22/23 checks passed. The unit check encountered 24 dependency-import failures, 20 native PTY failures, and one unrelated worktree-removal assertion. The dependency-path denial no longer reproduces with current dependency metadata; all 37 native PTY cases pass through the normal configured wrapper after the Node routing correction. The worktree assertion also fails on the original baseline with unchanged sources. Initial failure logs are retained. The final delta gate passed 20/20 selected checks, and the catalog-only gate passed 9/9; the initial broad unit check is still recorded as failed.
Review
No new polling, subprocess fanout, protocol fields, or typing-path work. Folder workspaces use the same shell path. Older hosts keep existing behavior; this fix requires updating the host and creating a new remote shell using the existing Bash, Zsh, Fish, or PowerShell wrapper. Absolute binary paths, command codex, and bare cmd.exe bypass those wrappers and retain their prior behavior. Configured shell arguments retain the existing daemon priority; custom Bash --rcfile or no-rc profiles may intentionally bypass wrapper installation. Desktop/mobile clipboard consumers use the existing OSC52 handling.
Agent skill upstream boundary
No upstream skill-installer source was copied.
Notes
Targets main after #34721 was merged. The original parent commit includes that already-merged one-line test-import repair.
macOS paired UI and Linux PowerShell 7 were exercised. Native Windows PowerShell 5.1, Windows .cmd, and live WSL were not run locally; CI covers supported platform checks.
Checklist
Focused change with before/after evidence.
Independent correctness, compatibility, cleanup, and performance review.
Final incremental local gates and final-head CI complete; the initial broad unit failure and reproduced baseline assertion remain documented above.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Walkthrough
The launch environment now carries a remote-viewer clipboard flag through shell startup and WSL forwarding. Codex wrappers use the flag to set a temporary SSH_CONNECTION value when neither SSH_CONNECTION nor SSH_TTY is set. Environment cleanup removes inherited clipboard flags unless explicitly supplied. The shell environment finalizer also preserves terminal shell arguments in the specified launch configuration.
Priority: Normal
Merge Risk: Low · up to 55b4e
The change is mergeable with a narrow follow-up: make the POSIX and fish cases assert the wrapped Codex call’s exit status directly.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: restoring clipboard copying for Codex sessions started manually in remote shells.
Description check
The description is mostly complete. It covers the user impact, implementation, rationale, testing, visual proof, compatibility limits, review notes, and checklist. The linked issue is referenced as #3…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is mostly complete. It covers the user impact, implementation, rationale, testing, visual proof, compatibility limits, review notes, and checklist. The linked issue is referenced as #34102, although the description does not explicitly identify it as the issue fixed by this PR.
Full details: Docstring Coverage
Explanation
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 15 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Check the status of codex clipboard in the POSIX and fish tests.
The POSIX and fish branches run command codex shell after codex clipboard and assert only result.status. That value comes from the trailing call, so the test never checks the clipboard call's exit status. The fake Codex returns FAKE_CODEX_EXIT for every non-help call, so a wrapper that drops or changes the clipboard status still produces the same final status and passes.
Save the status of codex clipboard before the bare call. Then exit with the saved value, or assert on it. Keep the environment check on the bare call.
This is a test-coverage gap. The current wrapper does not show a production failure.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ecf55902-087c-4ffb-b3d2-a5f42db54ba9
Commits
Reviewing files that changed from the base of the PR and between 483986d and 6984664.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
An Orca started from a remote viewer's pane inherits ORCA_REMOTE_VIEWER_CLIPBOARD,
which would make every local Codex fake an SSH session. Treat the marker as
per-spawn identity so only explicit launch env carries it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Typing
codexin a remote Orca shell could copy text only on the server. Newly created remote shells now make that manual launch send clipboard text back to the viewer, just like Codex launched from Orca's agent controls.What Changed
Pass the existing remote-viewer intent into shell startup and apply the Codex clipboard environment only inside its existing Bash, Zsh, Fish, and PowerShell wrappers. Keep the parent shell and inherited SSH values intact. Forward the intent across WSL using the existing environment channel.
Route native shell-startup and daemon PTY tests through the established Node pool; unchanged Bun PTY empty-output failures also reproduce on the original baseline.
Why
The existing clipboard setup only covered launches that already identified the agent as Codex. Manual shell launches missed it. This extends the existing path without changing selection or mouse behavior.
Linked Issue
Remote-terminal report supplied for this work. Related existing setup: #34102.
Visual Proof
Before: manual remote launch has no clipboard marker and the isolated viewer clipboard sink stays empty.
After: the same probe emits the expected text through the paired connection.
Real Codex 0.165.0
/copy, using an isolated saved response and no inference, deliveredREMOTE_CODEX_COPY_PROOFthrough production OSC52 parsing andclipboard:writeTerminalText.Testing
/copy; captured the final viewer clipboard write in an isolated sink. The real CLI also performed its native macOS host copy; that put the test marker on the host clipboard, so the sink did not isolate that native side effect.6fb19ed: all 65 reported CI checks settled successfully, including all unit shards, shell contracts, E2E, packaging, native-platform persistence, all WSL variants, CodeRabbit, and JavaScript/TypeScript and Swift CodeQL.ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: 22/23 checks passed. The unit check encountered 24 dependency-import failures, 20 native PTY failures, and one unrelated worktree-removal assertion. The dependency-path denial no longer reproduces with current dependency metadata; all 37 native PTY cases pass through the normal configured wrapper after the Node routing correction. The worktree assertion also fails on the original baseline with unchanged sources. Initial failure logs are retained. The final delta gate passed 20/20 selected checks, and the catalog-only gate passed 9/9; the initial broad unit check is still recorded as failed.Review
No new polling, subprocess fanout, protocol fields, or typing-path work. Folder workspaces use the same shell path. Older hosts keep existing behavior; this fix requires updating the host and creating a new remote shell using the existing Bash, Zsh, Fish, or PowerShell wrapper. Absolute binary paths,
command codex, and barecmd.exebypass those wrappers and retain their prior behavior. Configured shell arguments retain the existing daemon priority; custom Bash--rcfileor no-rc profiles may intentionally bypass wrapper installation. Desktop/mobile clipboard consumers use the existing OSC52 handling.Agent skill upstream boundary
Notes
Targets
mainafter #34721 was merged. The original parent commit includes that already-merged one-line test-import repair.macOS paired UI and Linux PowerShell 7 were exercised. Native Windows PowerShell 5.1, Windows
.cmd, and live WSL were not run locally; CI covers supported platform checks.Checklist