Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Jan 27, 2026

What was happening

The AI chat would sometimes stop working in the middle of a conversation. Users saw a network error in their browser, even though the server processed everything correctly.

Why it was happening

When the AI searches for documents, we were sending the full search results (about 30KB of data) back to the browser. This large amount of data was causing problems with CloudFront (our content delivery service), which would sometimes close the connection unexpectedly.

What we changed

We now send an empty result instead of the full search data.

This works because:

  • The browser only uses this event to show "Analyzing..." text
  • The browser never shows the actual search results to the user
  • The AI already has the search results and can still answer the question

Result

  • Before: Sent ~30KB of data (sometimes caused errors)
  • After: Sent ~50 bytes of data (no more errors)
  • Users see no difference in how the chat works

@reakaleek reakaleek requested a review from a team as a code owner January 27, 2026 09:36
@reakaleek reakaleek requested a review from cotti January 27, 2026 09:36
@reakaleek reakaleek added the fix label Jan 27, 2026
toolResult!.ToolCallId.Should().Be("tool1");
toolResult.Result.Should().Contain("Found 10 docs");
// Result is intentionally empty - payload stripped to prevent CloudFront OAC buffering issues
toolResult.Result.Should().BeEmpty();
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HUGE

@reakaleek reakaleek merged commit 1c347c9 into main Jan 27, 2026
32 of 33 checks passed
@reakaleek reakaleek deleted the feature/fix-occassional-response-error branch January 27, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants