feat(agent): report cloud rtk token savings#3347
Conversation
Generated-By: PostHog Code Task-Id: 0cd57c96-660f-4e98-8153-e736f0ef5649
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Well-contained additive feature: emits a new RTK savings notification once per run with proper idempotency guard, secure env scrubbing on the subprocess call, timeout, and silent error handling. Good test coverage for all edge cases, no existing code paths changed.
|
Reviews (1): Last reviewed commit: "fix(agent): stabilize rtk savings shutdo..." | Re-trigger Greptile |
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
There was a problem hiding this comment.
Additive feature that emits RTK token savings once per run at session cleanup. The env-scrubbing concern raised in review was fixed (RTK_DB_PATH preserved in allowlist), idempotency is guarded by rtkSavingsAttempted flag, errors are silently swallowed, subprocess has a timeout, and test coverage is thorough.
Problem
Cloud runs can use RTK to compress verbose command output, but current production telemetry only compares total run tokens between rollout cohorts. That comparison is affected by workload and run length, so it cannot measure the command-output savings directly.
Changes
gainsummary at terminal cleanup without exposing process secrets to the subprocess._posthog/rtk_savingsevent before event ingest closes, including runtime and model context.