feat: add model selection for remote transcription - #22
Merged
Conversation
Add a dedicated endpointUrl column to transcript_settings, separating the endpoint URL from the model name (which was previously overloaded in the model column for remote providers). The remote transcription UI now shows three fields: Endpoint URL, Model Name, and API Key. The model name is sent as the 'model' parameter in the multipart form to OpenAI-compatible transcription endpoints. Also fixes a pre-existing bug where TranscriptSetting struct was missing the runpodApiKey field, causing potential runtime errors with SELECT *. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explain in the migration SQL and engine.rs fallback code why the URL is kept in both columns and when the fallback can be removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix P1 logic bug: migrated remote users would have their endpoint URL sent as the model name because model column still contains the URL. The new resolve_remote_params() helper detects when model equals the URL and treats it as empty. - Extract duplicated fallback logic into TranscriptConfig::resolve_remote_params() (was copy-pasted in validate_transcription_model_ready and get_or_init_transcription_engine). - Remove redundant isDoneDisabled condition in TranscriptSettings.tsx (remote-specific model check was already covered by isRemoteProvider check). - Use PRAGMA foreign_keys=off/on in migration to match existing convention (defer_foreign_keys was inconsistent with prior migrations). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The TranscriptSettings component initialized local draft state (uiProvider,
uiModel, uiEndpointUrl, uiApiKey) from the context prop via useState, but
never re-synced when the context updated after the async config load.
This caused endpointUrl to always appear empty because:
1. ConfigContext defaults to { provider: 'parakeet', model: '...' } (no endpointUrl)
2. Component mounts and initializes uiEndpointUrl = '' from the default
3. Async load completes and updates context with the saved endpointUrl
4. But useState initializer doesn't re-run -- local state stays empty
Fix: Add useEffect that syncs all local draft state when transcriptModelConfig
changes, ensuring the saved config is reflected after async load.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The endpointUrl was being wiped because multiple callers of api_save_transcript_config did not include it in the invoke payload. Since the UPSERT sets endpointUrl = excluded.endpointUrl, omitting it caused it to be set to NULL whenever any other component saved config. Fixed callers: - settings/page.tsx: include endpointUrl when loading config into state - Sidebar/index.tsx: pass endpointUrl in handleSaveTranscriptConfig - ParakeetModelManager.tsx: pass endpointUrl: null explicitly - WhisperModelManager.tsx: pass endpointUrl: null explicitly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Reviewed areas:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
endpointUrlcolumn totranscript_settings, separating endpoint URL from model name (previously overloaded in themodelcolumn for remote providers)modelparameter in the multipart form to OpenAI-compatible transcription endpointsTranscriptSettingstruct was missing therunpodApiKeyfieldKey Design Decisions
modelandendpointUrlcolumns for safe rollback. Rust code readsendpointUrlfirst with fallback tomodelmodelform parameter only sent when non-empty (some self-hosted servers don't expect it)resolve_remote_params()detects whenmodelequals the URL (migrated data) and treats it as empty to avoid sending URL as the model nameTest plan
endpointUrl, transcription still workscargo checkpassespnpm run buildpasses🤖 Generated with Claude Code