@@ -26,8 +26,6 @@ import (
2626 "github.com/charmbracelet/crush/internal/shell"
2727)
2828
29−const streamChunkTimeout = 2 * time.Minute
30−
3129type AgentEventType string
3230
3331const (
@@ -554,10 +552,6 @@ func (a *agent) streamAndHandleEvents(ctx context.Context, sessionID string, msg
554552 // Add the session and message ID into the context if needed by tools.
555553 ctx = context.WithValue(ctx, tools.MessageIDContextKey, assistantMsg.ID)
556554
557− // Process each event in the stream.
558− timer := time.NewTimer(streamChunkTimeout)
559− defer timer.Stop()
560−
561555loop:
562556 for {
563557 select {
@@ -565,9 +559,6 @@ loop:
565559 if !ok {
566560 break loop
567561 }
568− // Reset the timeout timer since we received a chunk
569− timer.Reset(streamChunkTimeout)
570−
571562 if processErr := a.processEvent(ctx, sessionID, &assistantMsg, event); processErr != nil {
572563 if errors.Is(processErr, context.Canceled) {
573564 a.finishMessage(context.Background(), &assistantMsg, message.FinishReasonCanceled, "Request cancelled", "")
@@ -576,9 +567,6 @@ loop:
576567 }
577568 return assistantMsg, nil, processErr
578569 }
579− case <-timer.C:
580− a.finishMessage(ctx, &assistantMsg, message.FinishReasonError, "Stream timeout", "No chunk received within timeout")
581− return assistantMsg, nil, ErrStreamTimeout
582570 case <-ctx.Done():
583571 a.finishMessage(context.Background(), &assistantMsg, message.FinishReasonCanceled, "Request cancelled", "")
584572 return assistantMsg, nil, ctx.Err()