-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: #2370 send truncate events independent of response state #2385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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: b906c24cf6
ℹ️ 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".
There was a problem hiding this comment.
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: d56b511778
ℹ️ 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".
| if audio_limits is not None: | ||
| _, max_audio_ms = audio_limits | ||
| truncated_ms = max(int(round(effective_elapsed_ms)), 0) | ||
| if max_audio_ms is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two lines can be removed
| if audio_limits is not None: | ||
| _, max_audio_ms = audio_limits | ||
| truncated_ms = max(int(elapsed_ms), 0) | ||
| if max_audio_ms is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest this:
- if max_audio_ms is not None:
- truncated_ms = min(truncated_ms, max_audio_ms)
- converted = _ConversionHelper.convert_interrupt(
- current_item_id,
- current_item_content_index,
- truncated_ms,
- )
- await self._send_raw_message(converted)
+ if self._ongoing_response or max_audio_ms is None or truncated_ms < max_audio_ms:
+ converted = _ConversionHelper.convert_interrupt(
+ current_item_id,
+ current_item_content_index,
+ truncated_ms,
+ )
+ await self._send_raw_message(converted)
This pull request resolves #2370 by fixing a bug in #2374
context: #2370 (comment)