Git generate commit message failing

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In the “Changes” panel when I click “Generate Commit Message” I get an error: “Failed to generate commit message: [invalid_argument] Error”

Steps to Reproduce

  1. Work from a git repo
  2. Make a change
  3. Go to “Changes” panel in Cursor IDE and click “Generate Commit Message” it fails

Expected Behavior

It should generate a commit message

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 3.1.17
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.4.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, this is an expected error, it just shows up in a messy way. Under the hood, Generate Commit Message sends the diff to the model with a 40K token limit, and if your staged changes don’t fit, the backend returns invalid_argument or “Request too long”. The client only shows [invalid_argument] Error, which doesn’t explain what went wrong. That’s on our side and we’ll fix it.

Workaround: commit in parts. Unstage some files, or unstage big hunks using Stage Selected Ranges, then generate a message for a smaller set and repeat. From your screenshot you have 5 files staged, try starting with 1 or 2. Most likely one change, maybe auth-splash.tsx or something else large, is blowing up the diff.

I’ll file a report about the bad error text so we can replace it with something like “changes too large, try staging fewer files”. If you still see this error with a small diff after reducing what’s staged, let me know and we’ll take a closer look.

This happening on my window machine as well, and for smaller single change as well. single file and single edit.

Not working

Hey @Onkar_Singh1, thanks for the report. Interesting one. The case in the thread above is related to a big diff that doesn’t fit into the model’s token limit. If yours is failing on a single file with one change, that’s a different story and we should dig deeper.

Can you share:

  • Your Cursor version: Help > About or Cursor > About Cursor
  • The Request ID for the failed attempt: open the chat, click the menu in the top right > Copy Request ID
  • A full screenshot of the error, plus roughly what file and change it is (type, size)

With that, I can tell if it’s the same error path or something else.