Skip to content

Scx9n revives#3660

Merged
beastoin merged 2 commits into
mainfrom
scx9n_revives
Dec 8, 2025
Merged

Scx9n revives#3660
beastoin merged 2 commits into
mainfrom
scx9n_revives

Conversation

@beastoin
Copy link
Copy Markdown
Collaborator

@beastoin beastoin commented Dec 8, 2025

No description provided.

beastoin and others added 2 commits December 9, 2025 00:09
Co-authored-by: aider (anthropic/claude-opus-4-5-20251101) <aider@aider.chat>
@beastoin beastoin merged commit cd10f66 into main Dec 8, 2025
1 check passed
@beastoin beastoin deleted the scx9n_revives branch December 8, 2025 17:28
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the websocket inactivity timeout logic. It changes the trigger for timeout from 'last audio received' to 'last activity of any kind', which is a good improvement to prevent sessions from closing while non-audio data is being transmitted. The timeout duration is also increased. My review includes one high-severity comment regarding code maintainability in the send_heartbeat function to ensure clarity and prevent future bugs.


# Inactivity timeout
if last_audio_received_time and time.time() - last_audio_received_time > inactivity_timeout_seconds:
if last_activity_time and time.time() - last_activity_time > inactivity_timeout_seconds:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

While this change is functionally correct, there's a maintainability issue in the send_heartbeat function. The variable last_activity_time is now used, but it's not declared as nonlocal at the top of the function, which is inconsistent with other variables from the enclosing scope. Additionally, last_audio_received_time is still declared nonlocal but is no longer used within this function.

To improve clarity and prevent potential bugs in future modifications, please update the nonlocal declarations as follows:

# In send_heartbeat() function
...
nonlocal websocket_close_code
nonlocal started_at
nonlocal last_activity_time  # Add this
# nonlocal last_audio_received_time  <- And remove this line
...

Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
* increase the stt inactivity timeout threshold due to the instability of audio bytes on some 3rd devices

* Use last_activity_time to track session inactivity timeout

Co-authored-by: aider (anthropic/claude-opus-4-5-20251101) <aider@aider.chat>

---------

Co-authored-by: aider (anthropic/claude-opus-4-5-20251101) <aider@aider.chat>
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.

1 participant