Skip to content

fix(telemetry): cap CLI event volume and switch PostHog to anonymous …#2829

Merged
Vaibhaav-Tiwari merged 2 commits into
AgentWrapper:mainfrom
laxmanclo:fix/telemetry-rate-limits
Jul 20, 2026
Merged

fix(telemetry): cap CLI event volume and switch PostHog to anonymous …#2829
Vaibhaav-Tiwari merged 2 commits into
AgentWrapper:mainfrom
laxmanclo:fix/telemetry-rate-limits

Conversation

@laxmanclo

@laxmanclo laxmanclo commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

CLI telemetry counted every invocation uncapped, and a few other events
(http errors, panics, generic renderer events) had no ceiling either.

This caps everything at the point it leaves the machine: CLI commands
report at most once per command per day (so polling loops become "used
today" instead of one event per call), events that need an actual count
(errors, crashes), and events bill as anonymous instead of identified since
our distinct id is just a random install id, not a person. Apart from that events like errors etc. are aggregated and have generous rate limits.

CLI telemetry had no rate limiting, so agent hooks and scripts polling
commands like ao status/ao session ls in loops drove a runaway PostHog
bill. ao.cli.invoked now caps at once per command path per day and
ao.app.active at once per day; both hooks/pty-host stay counted (not
excluded) so headless installs don't silently drop out of DAU. Events
bill as anonymous instead of identified since our distinct id is a
random install id, not a person. Usage-error telemetry no longer leaks
raw CLI args.

Adds a shared burst-plus-daily rate ceiling per event name for
everything else that had no cap at all (http 5xx, panics, renderer
events/exceptions), so a crash loop or retry loop can't repeat this.

Bursty daemon events (5xx, panics, usage errors) are aggregated into
one rollup per minute with a real count instead of being rate-limited
away, so a 6-error blip and a 10,000-error storm are still
distinguishable in PostHog, at a fraction of the event cost.
@laxmanclo
laxmanclo force-pushed the fix/telemetry-rate-limits branch from 35db475 to 0222150 Compare July 20, 2026 05:42

@Vaibhaav-Tiwari Vaibhaav-Tiwari left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just resolved the conflicts else looks good

golangci-lint (revive) requires exported-type doc comments to begin
with the type name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants