Skip to content

bug(subtitle): source-language text intermittently missing in dual (original + translation) display mode with OpenAI provider #327

Description

@jiangzhuo

Summary

Reported via user feedback email (Yachao, 2026-07-17).

With an OpenAI translation model and the subtitle display mode set to show both the original text and the translation, the original (source-language) line sometimes fails to appear. The translated text is usually displayed correctly; only the source line intermittently disappears. The reporter has not isolated whether it's OpenAI, the speech-recognition step, or Sokuji's subtitle display logic — needs investigation on our side.

Where to look

  1. OpenAI input transcription is asynchronous and optional. The source text for user speech comes from conversation.item.input_audio_transcription.completed (and .failed) events, which arrive on their own schedule — often after the assistant's translated response has started or completed, and sometimes not at all. Handlers live in:
    • src/services/clients/OpenAIClient.ts
    • src/services/clients/OpenAIGAClient.ts
    • src/services/clients/OpenAIWebRTCClient.ts
      Check whether a transcription that completes/fails late still updates the already-rendered subtitle entry, or is dropped once the item has scrolled/been superseded.
  2. Subtitle combine/window logic. src/components/Subtitle/SubtitleApp.tsx (~line 120, "Combine items with source tagging") mirrors MainPanel's logic in simplified form — verify that an item whose transcript is still empty at render time gets re-rendered when the transcript later lands, in both the Electron subtitle window and the extension overlay.
  3. Wire-format stripping (extension path). stripHeavyItemFields + windowing/throttling on the subtitle port intentionally trims item payloads — confirm the source transcript field always survives, including for items whose transcript arrives in a later update after the item left the forwarded window.
  4. Compare with MainPanel: does the same item show its original text in the main conversation view when the subtitle line is missing? That cleanly splits "transcription never arrived (OpenAI side)" from "subtitle display lost it (our side)".

Repro (as reported)

  1. Provider: OpenAI. Subtitle display mode: original + translation.
  2. Speak normally during a session.
  3. Occasionally a subtitle entry shows only the translated line; the source-language line is missing.

Frequency is intermittent; no exact trigger identified yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenai

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions