fix(voice): use monotonic STT event deadlines - #4571
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aad26e6b2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| patch("websockets.connect", return_value=mock_ws), | ||
| patch( | ||
| "time.time", | ||
| "time.monotonic", |
There was a problem hiding this comment.
Keep the monotonic mock away from the event-loop clock
Patching process-global time.monotonic also replaces the clock used by asyncio.BaseEventLoop.time(). During this async test, event-loop scheduling consumes the five-value side_effect and can raise StopIteration, strand pending tasks, or expire asyncio.wait_for independently of the STT deadline, so the test is failing or passing for the wrong reason. Mock only an STT-local clock dependency, or otherwise preserve the loop's real clock.
AGENTS.md reference: AGENTS.md:L200-L200
Useful? React with 👍 / 👎.
Summary
time.monotonic()for OpenAI STT event timeout accountingTesting
python -m compileall -qon changed source and test fileshttpx2was unavailable; dependency sync was blocked by package-index DNS failures