add reflex_episode_chache_bytes_total gauge + helper and EpisodeCache… - #106
Merged
Conversation
DsThakurRawat
self-requested a review
May 5, 2026 06:22
DsThakurRawat
enabled auto-merge (squash)
May 5, 2026 06:25
DsThakurRawat
disabled auto-merge
May 5, 2026 06:25
DsThakurRawat
enabled auto-merge (rebase)
May 5, 2026 06:41
DsThakurRawat
disabled auto-merge
May 5, 2026 06:41
DsThakurRawat
enabled auto-merge (squash)
May 5, 2026 06:42
DsThakurRawat
disabled auto-merge
May 5, 2026 06:42
DsThakurRawat
enabled auto-merge (rebase)
May 5, 2026 06:42
…to track bytes + emit Prometheus
AniketR10
force-pushed
the
episode-cache-bytes-metric
branch
from
May 5, 2026 06:51
26b8c30 to
0c23767
Compare
AniketR10
disabled auto-merge
May 5, 2026 10:34
AniketR10
enabled auto-merge (squash)
May 5, 2026 10:34
AniketR10
disabled auto-merge
May 5, 2026 17:03
huynna12
added a commit
to huynna12/reflex-vla
that referenced
this pull request
Jul 7, 2026
insert() never checked whether (episode_id, lang_hash) already existed
in the cache. Re-inserting an existing key would:
- leak _total_bytes (old entry's bytes never subtracted before the
new entry's bytes were added), permanently inflating the
tether_episode_cache_bytes_total gauge from FastCrest#106
- potentially evict an unrelated LRU entry at capacity, since the
eviction check runs off len(_cache), which doesn't grow on replace
- inflate stats.episode_count, documented as "unique episodes seen"
Not reachable via the current production caller (predict_action_chunk
only calls insert() after a lookup() miss), but insert() is public API
on the class FastCrest#103 asked to make byte-accurate, so this closes that gap
directly rather than leaving it latent.
Adds three regression tests; confirmed each fails against the prior
implementation (assert 1032 == 516, episode_count 2 vs 1, evictions 1
vs 0) before passing with the fix.
Also drops two pre-existing unused imports (dataclasses.field,
tests/test_episode_cache_bytes.py's pytest) in the files touched here —
mechanical, zero behavior change.
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… to track bytes + emit Promotheus
Description
Type of Change
How Has This Been Tested?
pytest tests/passes locallyreflex doctorsanity checkChecklist