Skip to content

Studio: keep an audio model's reply text beside its player (extracted from #6527) - #11074

Closed
donaldfilimon wants to merge 4 commits into
unslothai:mainfrom
donaldfilimon:voice/pr-d-audio-reply-text
Closed

donaldfilimon wants to merge 4 commits into
unslothai:mainfrom
donaldfilimon:voice/pr-d-audio-reply-text

Conversation

@donaldfilimon

Copy link
Copy Markdown
Contributor

Summary

One hunk extracted from #6527 by @BardiaKoopah and @LeoBorcherding, rebased onto current main as offered in this comment. It is independent of the voice conversation mode in #10373 and of the benchmark in #10374, so it is its own PR.

The non-streaming audio path in chat-adapter.ts renders only <audio-player> and drops result.choices[0].message.content. An audio model answers with both the clip and the text it spoke, and the text is the half that is searchable, copyable, readable on a muted device, and available to a screen reader. This renders the player above that text, the way a message with an attachment already reads elsewhere in the thread. A reply with no text renders exactly as before.

Eight lines, one file. The credit is theirs; this PR exists so the hunk can land without the rest of #6527.

Test plan

  • npm run typecheck clean on the rebased branch (d4a88a5, one commit on 71d85d5bb)
  • npm test: 7713 passed, 0 failed
  • Manual: load an audio model, send a prompt on the non-streaming path, confirm the reply shows the player followed by the spoken text

🤖 Generated with Claude Code

The non-streaming audio path renders only <audio-player> and drops
result.choices[0].message.content on the floor. The model returns both -- the
clip and the text it spoke -- and the text is the half that is searchable,
copyable, readable on a muted device, and available to a screen reader.

Show the player above it, which is how a message with an attachment already
reads elsewhere in the thread. A reply with no text renders exactly as before.

Extracted from PR #6527, where it was one hunk inside a much larger branch; it
is independent of the voice conversation mode and of every other part of it.

Co-authored-by: Bardia Koopah <[email protected]>
Co-authored-by: LeoBorcherding <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TSaSnTn9AUf4wPbCaTTykW

@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: d4a88a5b8d

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

The adapter now keeps the reply text beside the player tag, but the Markdown
renderer short-circuited on the tag and returned only the AudioPlayer, so the
transcript was stored and never shown. The tag is split out before the text
reaches the Markdown pipeline (a React-free helper, so it is unit-testable) and
the player renders above the remaining text; a clip-only reply renders exactly
as before. The conversation export already replaced the tag in place and kept
the surrounding text, so it needed nothing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@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: aeadd322f9

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

donaldfilimon and others added 2 commits September 16, 2026 00:33
…ks, whole

choices[0].message.content was a diagnostic label, '[Generated audio from:
"<text[:100]>"]', which the chat now renders under the player and keeps in
history. It is the spoken text itself now. The adapter drops the old label if
an older backend still sends it, so it is never shown as something the
assistant said.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…nd's label

The previous commit changed /audio/generate to answer with the spoken text but
landed without its test or the adapter's guard. This adds both: the route test
asserts a 200-character prompt comes back whole, and spokenReplyText drops the
old '[Generated audio from: ...]' label if an older backend still sends it, so
diagnostic text is never rendered as the assistant's words.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@donaldfilimon

Copy link
Copy Markdown
Contributor Author

This closed because its source fork was deleted, not because of review. The work, rebased on current main along with the fixes made since, continues in #12265, which consolidates #10373, #10374 and #11074 as separate --no-ff merges so each part can still be reviewed or reverted on its own.

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