-
Notifications
You must be signed in to change notification settings - Fork 9
[FEATURE] Add DOTNET_AICOMMITMESSAGE_IGNORE_API_ERRORS environment variable to bypass AI API failures gracefully #285
Copy link
Copy link
Open
Labels
DocumentationenhancementNew feature or requestNew feature or requestgitautoGitAuto label to trigger the app in a issue.GitAuto label to trigger the app in a issue.good first issueGood for newcomersGood for newcomershacktoberfestParticipation in the Hacktoberfest eventParticipation in the Hacktoberfest eventhelp wantedExtra attention is neededExtra attention is needed✨ featureNew feature requests or implementationsNew feature requests or implementations👷🏼 infrastructureInfrastructure-related tasks or issuesInfrastructure-related tasks or issues📝 documentationTasks related to writing or updating documentationTasks related to writing or updating documentation🕓 medium effortA task that can be completed in a few hoursA task that can be completed in a few hours🚀 performancePerformance optimizations or regressionsPerformance optimizations or regressions🚨 securitySecurity-related issues or improvementsSecurity-related issues or improvements🛠 WIPWork in progressWork in progress🧪 testsTasks related to testingTasks related to testing
Metadata
Metadata
Assignees
Labels
DocumentationenhancementNew feature or requestNew feature or requestgitautoGitAuto label to trigger the app in a issue.GitAuto label to trigger the app in a issue.good first issueGood for newcomersGood for newcomershacktoberfestParticipation in the Hacktoberfest eventParticipation in the Hacktoberfest eventhelp wantedExtra attention is neededExtra attention is needed✨ featureNew feature requests or implementationsNew feature requests or implementations👷🏼 infrastructureInfrastructure-related tasks or issuesInfrastructure-related tasks or issues📝 documentationTasks related to writing or updating documentationTasks related to writing or updating documentation🕓 medium effortA task that can be completed in a few hoursA task that can be completed in a few hours🚀 performancePerformance optimizations or regressionsPerformance optimizations or regressions🚨 securitySecurity-related issues or improvementsSecurity-related issues or improvements🛠 WIPWork in progressWork in progress🧪 testsTasks related to testingTasks related to testing
I'm using
dotnet-aicommitmessageto generate commit messages based on branch name, commit message, andgit diffvia an AI model. However, in some environments (e.g., corporate or restricted networks), API calls to the AI provider may fail due to network restrictions or policies.Currently, when an API error occurs, the tool throws an exception internally and simply returns the original message without any transformation, which can interrupt workflows unexpectedly.
🧩 Feature Request
Introduce a new environment variable:
DOTNET_AICOMMITMESSAGE_IGNORE_API_ERRORS=trueWhen this variable is set:
If a network/API error occurs when calling the AI model, the tool should gracefully catch and suppress the exception.
Instead of failing, it should continue processing and fallback to returning the original or partially transformed message as needed.
This would be especially helpful in CI/CD pipelines or developer environments where occasional API issues shouldn't block the commit process.
✅ Existing Related Functionality
There is already a
-skipaiflag that can be appended to the commit message (e.g.,-skipai) to skip AI processing entirely. This new env variable would complement that by providing a more transparent fallback mechanism when issues arise, without requiring changes to individual commit messages.💡 Suggested Behavior
📌 Notes
This should ideally log a warning (not error) when
DOTNET_AICOMMITMESSAGE_IGNORE_API_ERRORSis active and an exception occurs, to aid debugging.