GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(cursor): steer Windows bridge shell away from PS 5.1 syntax loops by Wibias · Pull Request #627 · lidge-jun/opencodex Conversation
|
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR replaces static native-shell denial text with shared host-shell-aware guidance and updates Cursor tool notes with Windows PowerShell 5.1 and POSIX command examples. Tests verify denial wording and generated platform-specific guidance. ChangesCursor shell guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 2611629ed2
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
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/adapters/cursor/native-exec-shell.ts`:
- Around line 30-32: The shell guidance in native-exec-shell.ts must explicitly
allow at most one corrected bridge attempt, then require reporting the failure
and stopping; update both Windows and non-Windows branches to prevent repeating
equivalent commands. Apply the same retry-stop contract to both fallback notes
in tool-definitions.ts, covering each platform-specific instruction without
changing unrelated guidance.
In `@tests/cursor-native-exec-policy.test.ts`:
- Around line 145-146: Update nativeShellDisabledMessage() and the rejection
test to make platform selection injectable, defaulting to process.platform for
existing callers. Add deterministic coverage that exercises both the POSIX and
win32 message branches through the same rejection path, asserting each
platform-specific wording rather than only generic text.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 764aa1bc-b8a7-4663-8fbb-82a663a37913
src/adapters/cursor/native-exec-shell.tssrc/adapters/cursor/tool-definitions.tstests/cursor-native-exec-policy.test.tstests/cursor-tool-definitions.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ance Drop proxy-OS platform branching and `;`-as-`&&` advice; use if ($?) and one corrected bridge attempt for Codex/CodeRabbit feedback on #627.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
✅ Action performedReview finished.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
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/adapters/cursor/native-exec-shell.ts`:
- Around line 35-37: Update the shell guidance in
src/adapters/cursor/native-exec-shell.ts:35-37 and
src/adapters/cursor/tool-definitions.ts:420-423 to explicitly state that
PowerShell 5.1 does not support && or ||, and require if ($?) { ... } for
conditional follow-up steps; add matching assertions in
tests/cursor-native-exec-policy.test.ts:146-149 and
tests/cursor-tool-definitions.test.ts:335-337.
In `@tests/cursor-native-exec-policy.test.ts`:
- Around line 146-149: Update the deniedShellText assertions in the
cursor-native execution policy regression test to explicitly require guidance
that PowerShell 5.1 does not support &&. Preserve the existing assertions for if
($?), semicolon handling, and the PowerShell version while adding coverage for
the rejected && syntax.
In `@tests/cursor-tool-definitions.test.ts`:
- Around line 335-337: Update the assertions for the PowerShell note in the
relevant cursor tool definition test to explicitly verify that `&&` is
unsupported and that `if ($?)` is the replacement. Replace or supplement the
existing semicolon assertion while preserving the checks for the corrected
bridge-attempt limit.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b583905e-d035-477e-99d5-859095a12a32
src/adapters/cursor/native-exec-shell.tssrc/adapters/cursor/tool-definitions.tstests/cursor-native-exec-policy.test.tstests/cursor-tool-definitions.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
CodeRabbit follow-up: make unsupported-parser-error wording explicit and assert it in rejection/guidance tests.
|
@codex review Note: prior windows-latest failure was unrelated suite flake (storage cleanup / policy-preview timeouts), not #604 guidance tests. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
🧩 Analysis chain🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== PR metadata and changed files ===' gh pr view 627 --repo lidge-jun/opencodex --json number,title,headRefName,baseRefName,mergeable,statusCheckRollup echo '=== PR diff ===' gh pr diff 627 --repo lidge-jun/opencodex -- \ src/adapters/cursor/native-exec-shell.ts \ src/adapters/cursor/tool-definitions.ts \ tests/cursor-native-exec-policy.test.ts \ tests/cursor-tool-definitions.test.ts echo '=== Source outlines ===' ast-grep outline src/adapters/cursor/native-exec-shell.ts --items all ast-grep outline src/adapters/cursor/tool-definitions.ts --items all echo '=== Relevant source occurrences with context ===' rg -n -C 10 \ 'nativeShellDisabledMessage|NATIVE_SHELL_DISABLED|rejectShellExecForPolicy|rejectShellStreamExecForPolicy|rejectBackgroundShellSpawnExecForPolicy|rejectWriteShellStdinExecForPolicy|buildCursorToolGuidanceSystemNote|hostShellNote' \ src/adapters/cursor/native-exec-shell.ts \ src/adapters/cursor/tool-definitions.ts echo '=== Relevant test assertions with context ===' rg -n -C 10 \ 'native shell|nativeShellDisabledMessage|PowerShell|cd /d|<<EOF|if \(\$\?\)|bridge attempt|host-shell-safe|buildCursorToolGuidanceSystemNote' \ tests/cursor-native-exec-policy.test.ts \ tests/cursor-tool-definitions.test.ts Length of output: 4369 🏁 Script executed: #!/bin/bash set -euo pipefail base_ref="origin/dev" if ! git rev-parse --verify "$base_ref" >/dev/null 2>&1; then base_ref="dev" fi merge_base="$(git merge-base "$base_ref" HEAD)" echo '=== Changed files relative to PR base ===' git diff --name-status "$merge_base" HEAD echo '=== Complete PR diff ===' git diff --no-ext-diff --unified=80 "$merge_base" HEAD -- \ src/adapters/cursor/native-exec-shell.ts \ src/adapters/cursor/tool-definitions.ts \ tests/cursor-native-exec-policy.test.ts \ tests/cursor-tool-definitions.test.ts echo '=== Source structure ===' ast-grep outline src/adapters/cursor/native-exec-shell.ts --items all ast-grep outline src/adapters/cursor/tool-definitions.ts --items all echo '=== Native shell policy implementation ===' nl -ba src/adapters/cursor/native-exec-shell.ts | sed -n '1,420p' echo '=== Cursor tool guidance implementation ===' nl -ba src/adapters/cursor/tool-definitions.ts | sed -n '1,420p' echo '=== Native shell policy tests ===' nl -ba tests/cursor-native-exec-policy.test.ts | sed -n '1,460p' echo '=== Cursor tool guidance tests ===' nl -ba tests/cursor-tool-definitions.test.ts | sed -n '1,520p' Length of output: 1504 🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== Authoritative PR file patches from GitHub ===' gh api --paginate \ 'repos/lidge-jun/opencodex/pulls/627/files?per_page=100' \ --jq '.[] | "FILE: \(.filename)\nSTATUS: \(.status)\nPATCH:\n\(.patch // "[no textual patch returned]")\n---"' echo '=== Locate reviewed files in checkout ===' for name in \ native-exec-shell.ts \ tool-definitions.ts \ cursor-native-exec-policy.test.ts \ cursor-tool-definitions.test.ts do fd -a -t f "^${name}$" . || true done echo '=== Native-shell implementation and guidance source ===' for path in \ src/adapters/cursor/native-exec-shell.ts \ src/adapters/cursor/tool-definitions.ts do if [ -f "$path" ]; then echo "--- $path ---" nl -ba "$path" | sed -n '1,460p' fi done echo '=== Relevant tests ===' for path in \ tests/cursor-native-exec-policy.test.ts \ tests/cursor-tool-definitions.test.ts do if [ -f "$path" ]; then echo "--- $path ---" nl -ba "$path" | sed -n '1,560p' fi done Length of output: 11519 🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== Native execution policy implementation (line-numbered via sed) ===' sed -n '=' src/adapters/cursor/native-exec-shell.ts | sed -n '1,280p' >/dev/null sed -n '1,280p' src/adapters/cursor/native-exec-shell.ts | cat -n echo '=== Guidance construction ===' sed -n '360,490p' src/adapters/cursor/tool-definitions.ts | cat -n echo '=== Bridge tool schemas and working-directory handling ===' rg -n -C 8 --type ts \ '(shell_command|exec_command|workingDirectory|working_directory|cwd)' \ src/adapters/cursor \ tests/cursor-tool-definitions.test.ts echo '=== All policy-denial function usage and focused test coverage ===' rg -n -C 8 --type ts \ '(rejectShellExecForPolicy|rejectShellStreamExecForPolicy|rejectBackgroundShellSpawnExecForPolicy|rejectWriteShellStdinExecForPolicy|nativeShellDisabledMessage|shellStream|backgroundShellSpawn|writeShellStdin)' \ src/adapters/cursor \ tests/cursor-native-exec-policy.test.ts echo '=== Full changed test sections ===' sed -n '1,280p' tests/cursor-native-exec-policy.test.ts | cat -n sed -n '250,380p' tests/cursor-tool-definitions.test.ts | cat -n Length of output: 180070
[P1] Keep filesystem policy-denial recovery guidance host-shell-safe — The PR updates shell-denial guidance and the system note to prevent replaying POSIX/CMD syntax through a PowerShell 5.1 bridge. However, native filesystem policy denials still tell the model to continue with:
This string is emitted by Please update this denial text to use the same host-shell-aware guidance as the new shell message—for example, POSIX The core shell change itself is otherwise consistent: I did not run tests because the review sandbox prohibits executing repository files. The current CI status retrieved during review showed ✅ Action performedReview finished.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ready to merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Transition complete for the Carry onto Go decision: deferred — Cursor tool-guidance / shell-bridge notes under |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…#627) * fix(cursor): steer Windows bridge shell away from PS 5.1 syntax loops Native-shell rejection told the model to replay the same bash/CMD command through the Codex bridge, which on Windows PowerShell 5.1 fails and loops (#604). Adapt for the host shell and inject PS-safe guidance instead. * fix(cursor): address #604 review — host-shell-neutral retry-stop guidance Drop proxy-OS platform branching and `;`-as-`&&` advice; use if ($?) and one corrected bridge attempt for Codex/CodeRabbit feedback on #627. * fix(cursor): state PowerShell 5.1 has no &&/|| in #604 guidance CodeRabbit follow-up: make unsupported-parser-error wording explicit and assert it in rejection/guidance tests.
fix(cursor): carry Windows bridge shell guidance onto dev2-go (#627)
…lidge-jun#627) * fix(cursor): steer Windows bridge shell away from PS 5.1 syntax loops Native-shell rejection told the model to replay the same bash/CMD command through the Codex bridge, which on Windows PowerShell 5.1 fails and loops (lidge-jun#604). Adapt for the host shell and inject PS-safe guidance instead. * fix(cursor): address lidge-jun#604 review — host-shell-neutral retry-stop guidance Drop proxy-OS platform branching and `;`-as-`&&` advice; use if ($?) and one corrected bridge attempt for Codex/CodeRabbit feedback on lidge-jun#627. * fix(cursor): state PowerShell 5.1 has no &&/|| in lidge-jun#604 guidance CodeRabbit follow-up: make unsupported-parser-error wording explicit and assert it in rejection/guidance tests.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug] Cursor Auto repeats tool continuations on Windows PowerShell 5.1, causing excessive token usage
There was an error while loading. Please reload this page.