Fix OpenAI file transcription finalization - #1030
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe OpenAI plugin now supports buffered live transcription for non-realtime file models, including previews, finalization, cancellation, explicit capability routing, expanded tests, and version updates to 1.3.1. ChangesOpenAI file transcription
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant OpenAIFileTranscriptionSession
participant OpenAIPlugin
participant OpenAIAPI
Client->>OpenAIPlugin: createLiveTranscriptionSession(capability)
OpenAIPlugin->>OpenAIFileTranscriptionSession: create file-model session
Client->>OpenAIFileTranscriptionSession: appendAudio(chunks)
OpenAIFileTranscriptionSession->>OpenAIPlugin: request preview transcription
OpenAIPlugin->>OpenAIAPI: submit buffered audio
OpenAIAPI-->>Client: preview progress
Client->>OpenAIFileTranscriptionSession: finish()
OpenAIFileTranscriptionSession->>OpenAIPlugin: request final transcription
OpenAIPlugin->>OpenAIAPI: submit complete audio
OpenAIAPI-->>Client: final transcription
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@TypeWhisperPluginSDK/Plugins/OpenAIPlugin/OpenAIPlugin.swift`:
- Around line 1073-1083: Update the preview flow in appendAudio around
shouldRequestPreview and transcribe to prevent overlapping requests: add an
in-flight guard, mark it before awaiting transcribe, and clear it on every
completion path. While a request is active, retain/coalesce newly appended audio
so the latest preview is evaluated and requested after completion rather than
starting concurrent requests. Add a test covering a delayed transcription and
confirming requests remain serialized.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 589cfc08-8904-428a-bb65-63a0c4411e2f
📒 Files selected for processing (4)
TypeWhisper.xcodeproj/project.pbxprojTypeWhisperPluginSDK/Plugins/OpenAIPlugin/OpenAIPlugin.swiftTypeWhisperPluginSDK/Plugins/OpenAIPlugin/Tests/OpenAIPluginTests.swiftTypeWhisperPluginSDK/Plugins/OpenAIPlugin/manifest.json
Summary
Root cause
The OpenAI plugin advertised live transcription globally, but
gpt-transcriberejected native live session creation because it is a file model. The host then promoted the last batch preview when live finalization returned no result, so audio after the final preview could be lost.User impact
Dictation with GPT Transcribe now retains words spoken after the last preview, including endings after a pause, without requiring a new host version.
Test plan
swift test --package-path TypeWhisperPluginSDK --filter OpenAIPluginTests/Users/marco/Projects/typewhisper-dev-tools/build-typewhisper-plugin-dev.sh --clean --run OpenAIPlugin /Users/marco/.codex/worktrees/8e5d/typewhisper-macusedLiveResult=true.Summary by CodeRabbit