Skip to content

fix(voice): use monotonic STT event deadlines - #4571

Open
hsusul wants to merge 2 commits into
openai:mainfrom
hsusul:fix/stt-monotonic-deadline
Open

fix(voice): use monotonic STT event deadlines#4571
hsusul wants to merge 2 commits into
openai:mainfrom
hsusul:fix/stt-monotonic-deadline

Conversation

@hsusul

@hsusul hsusul commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use time.monotonic() for OpenAI STT event timeout accounting
  • update the timeout regression test to control the monotonic clock

Testing

  • python -m compileall -q on changed source and test files
  • focused pytest was attempted but this fresh worktree could not import the repository because optional dependency httpx2 was unavailable; dependency sync was blocked by package-index DNS failures

@seratch seratch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you fix the CI errors?

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants