Skip to content

Gemini works indefinitely to generate a response when reviewing a git diff #11765

@westonruter

Description

@westonruter

What happened?

I am running Gemini CLI in the WordPress/wordpress-develop codebase.

I check out a branch and I prompt Gemini with:

Look at the diff of git diff trunk... and review it for any issues.

Then Gemini keeps spinning and spinning endlessly (longest I've waited before giving up is over 18 minutes) until I finally cancel the request. This issue has been happening consistently (maybe every time) for about a week now. I haven't been able to use Gemini in my workflow because of this. I just see this:

Image

In this example, the diff I'm asking to review is quite small:

git diff trunk...
diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index 2f22ec25f8..ba6066c47c 100644
--- a/src/wp-includes/formatting.php
+++ b/src/wp-includes/formatting.php
@@ -2294,10 +2294,10 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
 	$title = strtolower( $title );
 
 	if ( 'save' === $context ) {
-		// Convert &nbsp, &ndash, and &mdash to hyphens.
-		$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );
-		// Convert &nbsp, &ndash, and &mdash HTML entities to hyphens.
-		$title = str_replace( array( ' ', ' ', '–', '–', '—', '—' ), '-', $title );
+		// Convert &nbsp, non-breaking hyphen, &ndash, and &mdash to hyphens.
+		$title = str_replace( array( '%c2%a0', '%e2%80%91', '%e2%80%93', '%e2%80%94' ), '-', $title );
+		// Convert &nbsp, non-breaking hyphen, &ndash, and &mdash HTML entities to hyphens.
+		$title = str_replace( array( ' ', '‑', ' ', '–', '–', '—', '—' ), '-', $title );
 		// Convert forward slash to hyphen.
 		$title = str_replace( '/', '-', $title );
 
diff --git a/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php b/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php
index 5c7a81cb29..8a2ee4f9d9 100644
--- a/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php
+++ b/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php
@@ -85,6 +85,20 @@ class Tests_Formatting_SanitizeTitleWithDashes extends WP_UnitTestCase {
 		$this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do — the — Dash', '', 'save' ) );
 	}
 
+	/**
+	 * @ticket 64089
+	 */
+	public function test_replaces_non_breaking_hyphen() {
+		$this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do‑the Dash', '', 'save' ) );
+	}
+
+	/**
+	 * @ticket 64089
+	 */
+	public function test_replaces_non_breaking_hyphen_entity() {
+		$this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do ‑ the Dash', '', 'save' ) );
+	}
+
 	public function test_replaces_iexcel_iquest() {
 		$this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just ¡a Slug', '', 'save' ) );
 		$this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just a Slug¿', '', 'save' ) );

What did you expect to happen?

Gemini should response with some result, not spin endlessly. There should at least be some timeout with an error message saying why it wasn't able to review the changes.

Client information

  • CLI Version: 0.10.0
  • Git Commit: 5d92b50
  • Session ID: 73f6058f-e14f-45b7-a9c9-c634917db311
  • Operating System: darwin v24.10.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-pro
  • Memory Usage: 370.9 MB

Login information

Google Account

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions