Skip to content

Studio: hand the audio route's heal gate the request's contract, and follow the hoisted audio_base64 in the turn-scope check - #16023

Merged
danielhanchen merged 2 commits into
mainfrom
tests-follow-lfm3-audio-route
Oct 29, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
tests-follow-lfm3-audio-route

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Two checks went red on main with #15889 (LFM3-Audio / LFM3-Omni on MLX). They fail every PR's Backend CI (Python 3.13, g-r) shard and Repo tests (CPU, studio) job, for example on #15988 and #15934.

1. The audio-input route's heal gate did not get the request's contract

test_passthrough_healing.py::test_every_post_decode_reinterpreter_is_handed_the_request_s_own_contract requires every heal_gate / nudge_enabled call to be handed the request's response_format, so a constraining format withdraws tool-call healing. #15889 added a new call in the audio-input branch of routes/inference.py without that argument:

AssertionError: heal_gate/nudge_enabled not handed the contract at [30849]

The product side is where this belongs, not the test. Today the omission is harmless: that branch only runs when the request carries audio_base64 and the model has audio input, and earlier in the handler that same case refuses a constraining response_format. Forwarding _extract_response_format(payload) keeps the site under the same rule as the other nine. If that refusal is ever relaxed, the gate then does the right thing without anyone remembering this site.

2. The turn-scope check read audio_base64 as a literal

test_multi_chat_prompt_queue_contract.py::test_a_media_turn_stays_legacy_and_its_attachments_stay_turn_scoped checks that image_base64, audio_base64 and video_base64 are scanned from currentTurnMessages, never from thread history. #15889 hoisted the audio scan into const turnAudioBase64 = findLatestUserAudioBase64(currentTurnMessages, ...) so it can also gate modalities. The behaviour is unchanged, but the test matched the old inline text.

Here the test was wrong. It now reads every request body site for each field and follows a hoisted const to its definition. It then requires the value to be a findLatestUser*Base64(currentTurnMessages, ...) scan. A new test pins that reader on a hoisted value and on a history scan.

Verification

  • Both tests fail on main and pass here. test_passthrough_healing.py has 111 passed, test_multi_chat_prompt_queue_contract.py 17 passed.
  • Sabotage, frontend: pointing turnAudioBase64 at messages instead of currentTurnMessages fails the media turn test and names the sent expression.
  • Sabotage, backend: restoring main's routes/inference.py fails the contract test.
  • The 15 backend test files that touch audio_base64 or the heal gate: 2872 passed, 7 skipped.

…oisted audio_base64 in its turn-scope check

#15889 left two checks red on main:
- the audio-input route's heal_gate call did not forward response_format, which
  test_every_post_decode_reinterpreter_is_handed_the_request_s_own_contract requires of every site
- chat-adapter.ts now sends audio_base64 through turnAudioBase64, which the media turn test
  matched as a literal; the test now follows a hoisted const to its definition
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T18:25:54.794231Z 2cad17b Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 2cad17bb51

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 8c49443 into main Oct 29, 2026
2 of 55 checks passed
@danielhanchen
danielhanchen deleted the tests-follow-lfm3-audio-route branch October 29, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant