#5040: fix(config): migrate audio.transcription with any CLI command
Cluster:
Cross-Platform Fixes
## 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
#11602: fix(config): skip stale legacy config files when openclaw.json exists
by akoscz · 2026-02-08
77.9%
#7611: fix: migrate channels.telegram.token to botToken on config load
by luiginotmario · 2026-02-03
76.2%
#7652: fix(voice-call): fix Telnyx transcription (STT) not working
by tturnerdev · 2026-02-03
75.8%
#8014: fix(media-understanding): support legacy {file} placeholder in CLI ...
by Glucksberg · 2026-02-03
75.4%
#23669: refactor(logging): migrate node-host and tailscale console calls to...
by kevinWangSheng · 2026-02-22
74.7%
#13881: fix: Address Greptile feedback - test isolation and channel resolution
by trevorgordon981 · 2026-02-11
74.6%
#22632: docs: fix redirects and small reorg
by gianpaj · 2026-02-21
74.1%
#23572: feat(voice): enable voice note conversation loop for Telegram and W...
by davidrudduck · 2026-02-22
74.0%
#4878: fix: string/type handling and API fixes (#4537, #4380, #4373, #4547...
by lailoo · 2026-01-30
73.9%
#23339: fix: use snapshot.parsed for env ref restoration during migrate
by Mathew-Harvey · 2026-02-22
73.5%