Update agent.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2025-07-22 12:58:23 -03:00
committed by GitHub
parent e9ec258bc9
commit 8eeb04336e

View File

@@ -450,7 +450,7 @@ func (a *agent) createUserMessage(ctx context.Context, sessionID, content string
func (a *agent) streamAndHandleEvents(ctx context.Context, sessionID string, msgHistory []message.Message) (message.Message, *message.Message, error) {
ctx = context.WithValue(ctx, tools.SessionIDContextKey, sessionID)
if !a.toolsDone.Load() {
return message.Message{}, nil, fmt.Errorf("tools not initialized yet")
return message.Message{}, nil, fmt.Errorf("Agent is still initializing, please wait a moment and try again")
}
eventChan := a.provider.StreamResponse(ctx, msgHistory, a.tools)