Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for customizable timeout for AI-generated commit messages #867

Open
seeseemelk opened this issue Jan 4, 2025 · 1 comment
Open
Assignees
Labels
requires-dependencies-update Belongs to some dependencies

Comments

@seeseemelk
Copy link

When using Ollama to generate commit messages, some larger files take a bit longer to generate the commit message for. For especially large files, this can result in a timeout:

Failed to generate commit message: System.AggregateException: One or more errors occurred. (A task was canceled.)
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
   at SourceGit.Models.OpenAIService.Chat(String prompt, String question, CancellationToken cancellation)
   at SourceGit.Commands.GenerateCommitMessage.GenerateChangeSummary(Change change)
   at SourceGit.Commands.GenerateCommitMessage.Result()
   at SourceGit.Views.AIAssistant.<OnOpened>b__2_0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
--- End of stack trace from previous location ---

   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
   at SourceGit.Models.OpenAIService.Chat(String prompt, String question, CancellationToken cancellation)
   at SourceGit.Commands.GenerateCommitMessage.GenerateChangeSummary(Change change)
   at SourceGit.Commands.GenerateCommitMessage.Result()

It would be nice if this timeout can be configured or even turned off completely.

@love-linger
Copy link
Collaborator

The OpenAI integration will be replaced with a new implementation after openai/openai-dotnet#21 is merged. You can test it from branch feat-openai.

@love-linger love-linger self-assigned this Jan 6, 2025
@love-linger love-linger added the requires-dependencies-update Belongs to some dependencies label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires-dependencies-update Belongs to some dependencies
Projects
None yet
Development

No branches or pull requests

2 participants