Skip to content

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

Closed

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”.
- 20–45 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.

Activity

  1. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: unknown.

  2. self-assigned this
    on Jul 28, 2026
  3. huaiqing-afk commented on Jul 31, 2026

    @huaiqing-afk
    ContributorAuthor

    I reproduced a regression in the error-recovery path of the Cursor adapter.

    Environment:

    • OpenCodex: ocx 2.7.43
    • Model: cursor/composer-2.5
    • Test: long multi-step tool workflow in an existing conversation

    Observed on 2026-07-30 at approximately 10:33–10:38 (Asia/Shanghai):

    1. The adapter received six consecutive HTTP 401 responses within a few seconds.
    2. Authentication then recovered and the adapter received eight successful HTTP 200 responses over the next several minutes.
    3. During this recovery period, the UI repeatedly displayed the same assistant continuation text, such as “继续完成……”, making the task appear to resume or continue multiple times.

    The local logs show exponential backoff between the 401 retries. I have omitted private conversation IDs and request IDs from this report.

    Control tests using cursor/auto, cursor/claude-opus-5, cursor/composer-2.5, and cursor/grok-4.5 completed the same 8-step tool workflow normally when all requests returned HTTP 200.

    This suggests the normal request path is working, while the authentication-error recovery path may replay or incorrectly merge streamed assistant content. Please investigate retry handling, conversation state restoration, and streamed-message deduplication after HTTP 401 responses.

    Image

    After several consecutive 401 responses, the same assistant continuation text was repeatedly appended in the UI. The issue was observed with cursor/composer-2.5 during a long tool workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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