Skip to content

Commit 118a689

Browse files
author
Mono
committed
fix: track routing decisions (cascade/direct) in streaming telemetry
Previously, streaming requests only updated streaming_used and tool_queries stats, but not cascade_used or direct_routed. This fix ensures routing decisions are properly recorded for streaming requests, matching the behavior of non-streaming run() method.
1 parent 6b8e8be commit 118a689

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cascadeflow/agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,6 +1946,11 @@ async def stream_events(
19461946
# Basic telemetry recording
19471947
self.telemetry.stats["total_queries"] += 1
19481948
self.telemetry.stats["streaming_used"] += 1
1949+
# 🔧 FIX: Track routing decision for streaming requests
1950+
if use_cascade:
1951+
self.telemetry.stats["cascade_used"] += 1
1952+
else:
1953+
self.telemetry.stats["direct_routed"] += 1
19491954
if tools:
19501955
if "tool_queries" not in self.telemetry.stats:
19511956
self.telemetry.stats["tool_queries"] = 0

0 commit comments

Comments
 (0)