on main help sign in
fix: race condition where title might not be generated (#1844)
commit87df08c4088afb265a3886380db96ca6387c518d authorChristian Rocha <christian@rocha.is> dateTue 13 Jan 2026, 11:29 (9 months ago) parent5f1d92a
1 file changed+1−1
internal/agent/agent.go+1−1
internal/agent/agent.go+1−1
@@ -183,6 +183,7 @@ func (a *sessionAgent) Run(ctx context.Context, call SessionAgentCall) (*fantasy
183183 a.generateTitle(titleCtx, call.SessionID, call.Prompt)
184184 })
185185 }
186+ defer wg.Wait()
186187
187188 // Add the user message to the session.
188189 _, err = a.createUserMessage(ctx, call)
@@ -491,7 +492,6 @@ func (a *sessionAgent) Run(ctx context.Context, call SessionAgentCall) (*fantasy
491492 }
492493 return nil, err
493494 }
494− wg.Wait()
495495
496496 if shouldSummarize {
497497 a.activeRequests.Del(call.SessionID)