fix(git_app): add retry mechanism for commit message generation#2772
Merged
tusharmath merged 1 commit intomainfrom Apr 1, 2026
Merged
fix(git_app): add retry mechanism for commit message generation#2772tusharmath merged 1 commit intomainfrom
tusharmath merged 1 commit intomainfrom
Conversation
This was referenced Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a retry mechanism to commit message generation so that transient LLM failures or empty responses are automatically retried instead of surfacing as errors to the user.
Context
Commit message generation relies on an LLM call, which can occasionally fail transiently or return an empty message due to model hiccups, rate limits, or network blips. Previously these failures would propagate immediately as errors, forcing the user to manually re-invoke the command. This change wraps the generation call in the project's existing
retry_with_configinfrastructure, providing automatic resilience.Changes
CloneonDiffContextso it can be passed into the retry closure on each attemptgenerate_message_from_diffwithretry_with_config, pulling retry settings from the project config (services.get_config().retry)Retryableerror when the LLM produces an empty commit message, triggering a retry rather than silently returning a blank stringKey Implementation Details
The retry configuration is sourced from
get_config().retry, falling back toRetryConfig::default()when not set. The empty-message check is placed after parsing the LLM response so only the generation + parse step is retried — not the diff truncation or context-building logic.Testing
Links