Cursor-agent hangs in GitHub Action after executing command

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

When running cursor-agent in a GitHub Action the agent successfully completes performs the instructions requested in the prompt, but then hangs indefinitely.

Important: the very same command run in a local shell terminates sucessfully.

Steps to Reproduce

Run the following GitHub Action:

name: Cursor Code Review

on:
  workflow_dispatch:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

jobs:
  code-review:
    runs-on: ubuntu-latest
    timeout-minutes: 5
   
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Install Cursor CLI
      run: |
        curl https://cursor.com/install -fsS | bash
        echo "$HOME/.local/bin" >> $GITHUB_PATH
        cursor-agent --version

    - name: Perform code review
      env:
        CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
        MODEL: auto
      run: |
        cursor-agent \
            --force \
            --model="$MODEL" \
            --output-format=text \
            --print \
            "Say hello"

Expected Behavior

I’d expect cursor-agent in the headless mode to exit after processing the prompt.

Screenshots / Screen Recordings

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

cursor-agent: 2025.09.12-4852336

Does this stop you from using Cursor

Yes - Cursor is unusable

2 Likes

Thanks for the bug report. Team is looking into it.

1 Like

I’m experiencing the same problem. Cursor CLI works fine locally, but indefinitely hangs jobs in GitHub Actions. In the meantime we’ll explore Aider & Claude Code for our CI/CD AI needs.

I also have exactly the same issue, when i copied this example:

Model responds corectly that it done everything, but the job on github actions stuck

I wrote simple sh script via cursor

it’s parsing JSON output and stopping cursor-agent if see result in output. That can be used as workaround now.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.