Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ protected override async Task ProcessStreamAsync(PipeReader reader, PipeWriter w
"tool_call" when messageData.TryGetProperty("toolCalls", out var toolCalls) =>
TransformToolCall(id, timestamp, toolCalls),

"tool_message" when messageData.TryGetProperty("toolCallId", out var toolCallId)
&& messageData.TryGetProperty("result", out var result) =>
new AskAiEvent.ToolResult(id, timestamp, toolCallId.GetString()!, result.GetString()!),
// Frontend only uses tool_result to show "Analyzing..." status - result content not displayed
// Skip sending the large payload (~30KB) to prevent CloudFront OAC buffering issues
"tool_message" when messageData.TryGetProperty("toolCallId", out var toolCallId) =>
new AskAiEvent.ToolResult(id, timestamp, toolCallId.GetString()!, ""),

"agent_end" =>
new AskAiEvent.ConversationEnd(id, timestamp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ public async Task TransformAsyncWithRealLlmGatewayPayloadParsesAllEventTypes()
events[4].Should().BeOfType<AskAiEvent.ToolResult>();
var toolResult = events[4] as AskAiEvent.ToolResult;
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();

// Event 6: ai_message
events[5].Should().BeOfType<AskAiEvent.MessageComplete>();
Expand Down
Loading