Repository navigation
feat(stv): follow the service's startup status instead of a blind join timeout - #33
Merged
Merged
Conversation
…n timeout The inference service now sends a sessionPing every few seconds while a session is starting, naming the phase and elapsed time, and bounds each phase itself. From the first such report the client drops its fixed webrtc_join_timeout_s timer and fails only after startup_inactivity_timeout_s (default 20 s) of silence, so a long cold start is no longer cut off by a number the client had to guess. Each report is surfaced as STVEvent.SESSION_STARTING. A service that sends no reports is handled as before. Bumps ojin-client to 0.12.2.
A sessionPing whose fields had unexpected types raised in the transport and took the connection down with a misleading CONNECTION_CLOSED; the fields are now coerced loosely and left unset when odd. A first report arriving while close() was mid-teardown re-armed the silence watchdog, which later emitted an ERROR after CLOSED; close() now awaits the startup timer and both the report handler and the watchdog stop once closed. A server errorResponse also cancels the startup timer so no second ERROR can follow it. Docs name the event as direct-WebRTC only and both client-local settings; tests cover each case.
json.loads admits both literals and int() refuses them, which would have ended the session the same way a wrongly typed field did. Adds the regression test for a server errorResponse leaving no startup timer behind: with a slow ERROR listener the old code emitted a second WEBRTC_JOIN_TIMEOUT before closing.
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.
What & why
A direct-WebRTC start was bounded by a blind client-side total (
webrtc_join_timeout_s), and no client-side number is right for every cold start. The inference service now reports its startup progress: asessionPingevery few seconds beforesessionReady, carrying the phase (waiting_for_container,setting_up_session) and elapsed time, and it bounds each phase itself (companion change injournee-live/ojin, inference-proxy 0.7.11).This release makes the client follow that:
OjinSessionReadyPingcarriesphaseandelapsed_ms(bothNoneon an older service, which sends the bare ping).STVEvent.SESSION_STARTING(phase,elapsed_ms), emitted per report, so a bot can show which phase a slow start is in.WEBRTC_JOIN_TIMEOUT, message naming the last phase) only afterstartup_inactivity_timeout_s(default 20 s) of silence. The total is the service's responsibility.webrtc_join_timeout_s(default 90 s) applies.Release
Bumps
ojin-clientto 0.12.2; entries are under0.12.2inCHANGELOG.md. Merging publishes it to PyPI.Verification
uv run ruff format --check,uv run ruff check: clean.uv run pytest tests --ignore=tests/integration: 295 passed, including: reports past the join timeout keep the start alive and the session then connects; reports going silent fail the start with the last phase in the message; a bare ping from an older service still counts as progress; the transport parses both ping shapes.uvx pyright: the same 2 pre-existing errors inentities/interaction_messages.py, untouched here.