You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: telemetry event_count_bucket counts token deltas, making it incomparable across conversations #4673
architectureRelated to core architecture.bugSomething isn't workingpriority:mediumFor bugs, a serious source of annoyance, but not blocking a large number of users.ready-for-devIssue meets development readiness criteria
The subscriber registers through event_service.subscribe_to_events (conversation_service.py:2319), i.e. the same unfiltered PubSub as everything else, so it receives every token delta. The counter ships as event_count_bucket.
Repro
uv run pytest tests/agent_server/telemetry/ -q
Green today: no test asserts that deltas are excluded from event_count_bucket. To see the skew, run one conversation with stream=true and one without and compare the reported bucket.
Why it matters
The metric silently changes meaning depending on whether streaming was on and how verbose the model was. A streamed conversation with three tool calls can outscore a non-streamed conversation with thirty. Any dashboard or alert built on event_count_bucket is comparing token volume against conversation activity — and there is no way to tell from the data which one you're looking at.
Fix
Move the increment inside the match, or filter deltas before the subscriber sees them (same root cause, same one-line class of fix as the webhook issue). Note that either choice is a discontinuity in the existing metric; that's worth a heads-up to whoever consumes it rather than a silent correction.
Acceptance Criteria
Two identical conversations, one with stream=true and one without, report the same event_count_bucket.
Note for anyone landing here from #4671: this was closed by #4689 with a kind filter (Subscriber.receives_streaming_deltas), which is deliberately interim — the structural half, taking deltas off the shared bus entirely, is now #4696, added to the epic as step 1b. That step removes the flag.
One side effect of the filter is tracked separately in #4695: _EventSubscriber does not opt in, and it is the subscriber that resets the runtime idle timer, so a long stream no longer keeps a managed pod alive.
architectureRelated to core architecture.bugSomething isn't workingpriority:mediumFor bugs, a serious source of annoyance, but not blocking a large number of users.ready-for-devIssue meets development readiness criteria
Activity
github-actions commentedon Aug 27, 2026
✅
ready-for-devlabel appliedThis issue meets the readiness criteria and is ready for contribution.
A contributor can now open a PR that links this issue (
Fixes #<number>).This is an automated check — no AI was used to generate this comment.
VascoSch92 commentedon Aug 28, 2026
Note for anyone landing here from #4671: this was closed by #4689 with a kind filter (
Subscriber.receives_streaming_deltas), which is deliberately interim — the structural half, taking deltas off the shared bus entirely, is now #4696, added to the epic as step 1b. That step removes the flag.One side effect of the filter is tracked separately in #4695:
_EventSubscriberdoes not opt in, and it is the subscriber that resets the runtime idle timer, so a long stream no longer keeps a managed pod alive.