Skip to content

[Bug] Cursor Auto repeats tool continuations on Windows PowerShell 5.1, causing excessive token usage #604

Description

@huaiqing-afk

Client or integration

Codex App

Area

CLI

Summary

When using OpenCodex with cursor/auto from the Codex App on Windows, simple coding tasks can enter a loop of repeated tool continuations and near-duplicate tool calls.

Tasks that should take a few tool calls can generate 20–45 calls and many repeated progress messages, resulting in unusually high token usage. The issue is especially noticeable after a shell command fails.

Expected behavior: after a tool result or command failure, the model should retain the tool-call context, adjust the command once, or report the failure clearly.

Actual behavior: the model often repeats planning messages and equivalent tool calls, such as “continue using Codex shell bridge”, without making meaningful progress.

Image Image Image

Reproduction

  1. Use OpenCodex with the Cursor provider and model cursor/auto.
  2. Run it from Codex App on Windows with Windows PowerShell 5.1 as the shell.
  3. Ask for a small repository task, for example: inspect one file, make a small edit, and run a verification command.
  4. If Cursor generates a Bash, CMD, or PowerShell 7-only command, let it fail.
  5. Observe that OpenCodex/Cursor may repeatedly continue the task, re-plan, or repeat similar tool calls instead of recovering once or stopping with a clear error.

Examples of incompatible commands observed on Windows PowerShell 5.1:

cd /d D:\path && git status

$(cat <<EOF
...
EOF
)
```powershell

cd /d is CMD syntax, && is not supported by Windows PowerShell 5.1, and the heredoc example is Bash syntax.

### Version

2.7.42

### Operating system

Windows 11 24H2, Windows PowerShell 5.1

### Provider and model

cursor / auto

### Logs or error output

```shell
Observed behavior:
- Multiple independent successful proxy requests are issued for one small task.
- Repeated assistant messages such as: continue using Codex shell bridge.
- 2045 tool calls for tasks that normally require only a few calls.
- Shell failures frequently precede the repetition loop.

Example PowerShell 5.1 incompatibilities:
- `cd /d ... && ...`
- Bash heredoc: `$(cat <<EOF ... EOF)`

Screenshots and supporting files

I can provide redacted screenshots showing repeated tool continuations and repeated calls for a single task. No credentials, tokens, account identifiers, or private repository content are included.

Image Image Image

Redacted configuration

{
  "provider": "cursor",
  "model": "auto",
  "client": "Codex App",
  "shell": "Windows PowerShell 5.1",
  "platform": "Windows"
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions