hotfix(transcribe): add missing import random (#6022)#6035
Merged
Conversation
The _pusher_reconnect_loop uses random.random() for backoff jitter but import random was missing, causing NameError in production. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis is a one-line hotfix that adds the missing
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant RL as _pusher_reconnect_loop
participant R as random (stdlib)
participant P as Pusher Client
RL->>RL: connection failure detected
RL->>RL: compute base delay (exponential backoff)
RL->>R: random.random() — jitter ±25%
R-->>RL: float in [0.0, 1.0)
RL->>RL: delay *= 0.75 + jitter * 0.5
RL->>RL: asyncio.sleep(delay)
RL->>P: attempt reconnect
P-->>RL: success / failure
Reviews (1): Last reviewed commit: "fix(transcribe): add missing import rand..." | Re-trigger Greptile |
Glucksberg
pushed a commit
to Glucksberg/omi-local
that referenced
this pull request
Apr 28, 2026
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.
Fixes NameError in production:
name 'random' is not definedat transcribe.py:1514.The
_pusher_reconnect_loop(from PR #6030) usesrandom.random()for backoff jitter but theimport randomstatement was missing. This causes the reconnect loop to crash immediately, preventing circuit breaker recovery.One-line fix: add
import randomto the stdlib imports.by AI for @beastoin