Skip to content

Omit undersized WAV output from Code Mode - #41934

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/342b4bdbc65db4238580f9cdc372763c2576eca5
Aug 31, 2026
Merged

Omit undersized WAV output from Code Mode#41934
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/342b4bdbc65db4238580f9cdc372763c2576eca5

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 31, 2026

Copy link
Copy Markdown

Omit undersized WAV output from Code Mode

Why

Audio models cannot reliably encode tool-generated clips shorter than 25 ms.

What changed

  • Measure the available audio frames in base64-encoded PCM and IEEE float WAV outputs.
  • Replace clips under 25 ms with explanatory text while preserving surrounding Code Mode output.
  • Leave clips at or above the threshold and unrecognized audio formats unchanged.

Testing

  • Cover the duration boundary across multiple sample rates and all supported audio() input forms.
  • Verify bounded and truncated WAV chunks, output after yield_control(), and end-to-end mixed text and audio output.

## Why

Audio models cannot reliably encode tool-generated clips shorter than 25 ms.

## What changed

- Measure the available audio frames in base64-encoded PCM and IEEE float WAV outputs.
- Replace clips under 25 ms with explanatory text while preserving surrounding Code Mode output.
- Leave clips at or above the threshold and unrecognized audio formats unchanged.

## Testing

- Cover the duration boundary across multiple sample rates and all supported `audio()` input forms.
- Verify bounded and truncated WAV chunks, output after `yield_control()`, and end-to-end mixed text and audio output.

GitOrigin-RevId: 342b4bdbc65db4238580f9cdc372763c2576eca5
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/342b4bdbc65db4238580f9cdc372763c2576eca5 branch from f432a9b to 981d6b6 Compare August 31, 2026 23:36
@copyberry
copyberry Bot merged commit 981d6b6 into main Aug 31, 2026
23 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/342b4bdbc65db4238580f9cdc372763c2576eca5 branch August 31, 2026 23:37
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants