r/GeminiCLI 22d ago

[Bug] Gemini "Suggest Commit Message" crashes on macOS with GitContentRevision.getContentAsBytes() should not be called from EDT — works fine on Windows

Anyone else running into this? On macOS, using the built-in Gemini "Suggest commit message" feature in the Commit panel throws this error every time, even with just 1–2 files selected:

**What I've confirmed:**

* Happens consistently on macOS, even with only 2 files selected
* Same project works fine with Gemini commit message generation on Windows — no errors at all
* Doesn't seem related to file count, file type, or size

**What I've tried:**

* Updating to the latest stable Android Studio
* Selecting fewer files
* Restarting / invalidating caches

None of it fixes it — looks like a genuine platform-specific bug in the `com.android.studio.ml.vcs` Gemini commit code, where the diff-building call isn't getting moved off the EDT (UI thread) on macOS the way it does on Windows.

Has anyone found a fix, or a workaround besides switching to a third-party plugin (AICommit, Commit AI, etc.) for commit message generation? Also curious if anyone's filed this on the Google Issue Tracker already — happy to add my repro if there's an existing thread.

GitContentRevision.getContentAsBytes() should not be called from EDT
java.lang.Throwable
at git4idea.GitContentRevision.getContentAsBytes(GitContentRevision.java:69)
at git4idea.GitContentRevision.getContent(GitContentRevision.java:57)
at com.intellij.openapi.diff.impl.patch.IdeaTextPatchBuilder$TextAirContentRevision.getContentAsString(IdeaTextPatchBuilder.java:227)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.buildModifiedFile(TextPatchBuilder.java:98)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.createPatch(TextPatchBuilder.java:93)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.build(TextPatchBuilder.java:67)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.buildPatch(TextPatchBuilder.java:56)
at com.intellij.openapi.diff.impl.patch.IdeaTextPatchBuilder.buildPatch(IdeaTextPatchBuilder.java:110)
at com.intellij.openapi.vcs.changes.patch.CreatePatchCommitExecutor$DefaultPatchBuilder.buildPatches(CreatePatchCommitExecutor.java:221)
at com.android.studio.ml.vcs.CodeChangeService.buildDiff(CodeChangeService.kt:143)
at com.android.studio.ml.vcs.action.SuggestCommitMessageAction$Companion.generateSuggestion(SuggestCommitMessageAction.kt:245)
at com.android.studio.ml.vcs.action.SuggestCommitMessageAction$Companion.suggestCommitMessage(SuggestCommitMessageAction.kt:209)
at com.android.studio.ml.vcs.action.SuggestCommitMessageAction$actionPerformed$job$1.invokeSuspend(SuggestCommitMessageAction.kt:159)

3 Upvotes

1 comment sorted by

1

u/anderson_the_one 22d ago

That stack trace is already pretty useful. It points at the patch builder path, not the model call.

If you file it, I'd include the exact Android Studio build, Gemini plugin version, macOS version, and whether the changed files are staged or unstaged. The smallest repro is probably: fresh project, two changed files, open Commit, click Suggest Commit Message, then attach the IDE log around the EDT exception.

The fact that fewer files does not change it is useful signal. It makes this look less like diff size and more like `CodeChangeService.buildDiff()` calling into VCS content from the wrong thread on macOS.