← Back to PRs

#5040: fix(config): migrate audio.transcription with any CLI command

by shayan919293 open 2026-01-31 00:10 View on GitHub →
## Summary Fixes #5017 - Custom audio transcription scripts (like `whisperx-transcribe.sh`) not working with the legacy `audio.transcription.command` config format. ## Root Cause Two bugs were preventing custom transcription scripts from working: 1. **CLI allowlist too restrictive**: The `AUDIO_TRANSCRIPTION_CLI_ALLOWLIST` in `mapLegacyAudioTranscription()` only contained `"whisper"`, causing scripts like `whisperx-transcribe.sh` to be silently rejected during migration. 2. **Migration nested incorrectly**: The `audio.transcription` migration was nested inside `routing.config-v2`, which early-exited when no `routing` section existed. Users with only `audio.transcription` (no `routing`) never got their config migrated. ## Changes - **`src/config/legacy.shared.ts`**: Removed `AUDIO_TRANSCRIPTION_CLI_ALLOWLIST` - the modern config format (`tools.media.audio.models`) has no such restriction, so this was only blocking legitimate legacy configs. - **`src/config/legacy.migrations.part-2.ts`**: - Extracted `audio.transcription` migration to a separate `audio.transcription-v2` migration entry - Updated error message from "unsupported transcription CLI" to "invalid or empty command" - **`src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts`**: Added test for custom script name migration ## Testing ```bash # All 31 tests pass pnpm vitest run src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts ``` Verified the fix works with the exact config from the issue: ```json { "audio": { "transcription": { "command": ["/home/user/.scripts/whisperx-transcribe.sh"], "timeoutSeconds": 120 } } } ``` Now correctly migrates to: ```json { "tools": { "media": { "audio": { "enabled": true, "models": [{ "type": "cli", "command": "/home/user/.scripts/whisperx-transcribe.sh", "timeoutSeconds": 120 }] } } } } ``` --- Pull Request opened by [Augment Code](https://www.augmentcode.com/) with guidance from the PR author <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR fixes legacy audio transcription migration by (1) removing the transcription CLI allowlist so custom script paths are migrated, and (2) moving the `audio.transcription` migration out of the `routing.config-v2` migration so it runs even when no `routing` section exists. It also updates the “unsupported CLI” change message to “invalid or empty command” and adds a regression test covering custom script names. These changes fit into the existing config migration pipeline (`LEGACY_CONFIG_MIGRATIONS_PART_2`) by ensuring legacy `audio.transcription`/`routing.transcribeAudio` values consistently map into the modern `tools.media.audio.models` structure and are then removed from the legacy locations. <h3>Confidence Score: 4/5</h3> - This PR is generally safe to merge and addresses a real migration gap with good test coverage. - The change is localized to legacy migration helpers and adds a regression test for the reported scenario. Main residual concern is that removing the allowlist makes migration more permissive, which could migrate some malformed legacy `command` values into the new config without additional sanity checks. - src/config/legacy.shared.ts (migration permissiveness around `command[0]` validation) <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs