docs(examples), test: fix first-run docs and timing flake#5593
docs(examples), test: fix first-run docs and timing flake#5593shizhigu wants to merge 5 commits intolivekit:mainfrom
Conversation
|
The current unit-tests failure is unrelated to this docs-only diff. It is the existing |
e848a4c to
41bc785
Compare
50a910e to
60a84ca
Compare
There was a problem hiding this comment.
🟡 Incomplete transformation: wall-clock timestamp check not converted in test_start_boundary_does_not_block_vad_interruption
The PR systematically converts all check_timestamp(*.created_at - t_origin, ...) calls to check_wallclock_event_timestamp(...) to use asymmetric tolerance (tighter early, looser late) and stabilize CI flakiness. However, line 757 in test_start_boundary_does_not_block_vad_interruption still uses the old check_timestamp with the symmetric max_abs_diff=0.75 for a wall-clock created_at - t_origin comparison. The new function's docstring at tests/test_agent_session.py:1094 explicitly states: "Use this for created_at event timestamps; keep check_timestamp for deterministic pipeline durations, playback positions, and same-turn deltas." This test remains susceptible to the same CI flakiness the PR aims to fix.
(Refers to line 757)
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
This keeps the examples first-run docs accurate and folds in the small AgentSession timing-test stabilization that was already opened as #5597.
The docs part fixes stale example paths and expands
examples/.env.exampleso a new user can see the common LiveKit/provider variables without hunting through every example. The test part fixes the repeated CI failure this PR hit twice intests/test_agent_session.py::test_tool_call: wall-clock event emission can be a little late under CI scheduler load, but duration/playback-position checks stay strict.I folded #5597 into this PR so reviewers do not have to reason about a docs PR blocked by a separate test-only PR.
What changed
examples/.env.examplewith commented, opt-in variables for common example categories.tests/test_agent_session.py.Testing
make checkPYTHONPATH="$PWD" uv run ruff check tests/test_agent_session.pyPYTHONPATH="$PWD" uv run ruff format --check tests/test_agent_session.pyPYTHONPATH="$PWD" uv run pytest tests/test_agent_session.py::test_generate_replyPYTHONPATH="$PWD" uv run pytest tests/test_agent_session.py::test_tool_call tests/test_agent_session.py::test_interruption_before_speaking tests/test_agent_session.py::test_generate_reply tests/test_agent_session.py::test_preemptive_generation -q7 passedPYTHONPATH="$PWD" uv run pytest tests/test_agent_session.py -q20 passedgit diff --check