#11846: media: suppress CUDA probe errors for whisper CLI
stale
Cluster:
Media Handling Improvements
## Summary
On systems without a compatible GPU (e.g. WSL2 without GPU passthrough), the auto-detected `whisper` CLI entry floods the logs with dozens of CUDA/GPU probe error lines before falling back to CPU — which works fine, just noisily.
This PR:
1. **Adds `env` option to `runExec`** (`src/process/exec.ts`) so callers can pass extra environment variables to child processes
2. **Adds `env` field to `MediaUnderstandingModelConfig`** (`src/config/types.tools.ts`) so CLI media entries can declare env vars in config
3. **Sets `CUDA_VISIBLE_DEVICES=""`** on the auto-detected whisper entry (`src/media-understanding/runner.ts`) to suppress GPU probing
4. **Wires it through `runCliEntry`** — merges `entry.env` into `process.env` when spawning the CLI process
### Before
```
CUDA error: no CUDA-capable device is detected
CUDA error: no CUDA-capable device is detected
... (30+ lines of GPU errors)
[whisper] falling back to CPU
[actual transcription output]
```
### After
```
[actual transcription output]
```
## Files Changed
- `src/process/exec.ts` — add optional `env` to `runExec` opts
- `src/config/types.tools.ts` — add `env?: Record<string, string>` to `MediaUnderstandingModelConfig`
- `src/media-understanding/runner.ts` — set `CUDA_VISIBLE_DEVICES=""` on whisper entry + pass `entry.env` in `runCliEntry`
## Notes
- Users can also use the `env` field in their config to set custom env vars for any CLI media entry
- The `env` is spread on top of `process.env`, so existing vars are preserved unless explicitly overridden
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds an `env` passthrough for CLI-based media understanding entries and uses it to set `CUDA_VISIBLE_DEVICES=""` for the auto-detected `whisper` CLI entry, reducing noisy CUDA probe logs on systems without a usable GPU. It wires the new `MediaUnderstandingModelConfig.env` through `runCliEntry` into `runExec` so child processes can receive extra environment variables.
<h3>Confidence Score: 3/5</h3>
- Mostly safe, but env handling in runExec can break CLI execution when callers pass partial envs.
- The change is small and scoped, but `runExec` forwards `env` directly without merging with `process.env`, which will drop PATH and other required variables if any caller uses the new option with a partial env object. That would cause runtime failures in affected CLI calls.
- src/process/exec.ts
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#9177: feat(media): add parakeet-mlx CLI output support
by mac-110 · 2026-02-04
70.9%
#9200: Fix: Strip dangerous env vars from baseEnv in host execution
by vishaltandale00 · 2026-02-05
70.8%
#15983: feat(exec): support env field in tools.exec config
by Imccccc · 2026-02-14
70.5%
#15914: feat: add messages.suppressMediaPlaceholders config option
by Shuai-DaiDai · 2026-02-14
69.3%
#8388: fix(media): auto-skip tiny/empty audio files before transcription (...
by Glucksberg · 2026-02-04
69.0%
#12388: docs: improve .env.example with comprehensive configuration examples
by dikshithreddym · 2026-02-09
68.3%
#21173: fix(config): support envFiles option in resolveConfigEnvVars for ga...
by Mellowambience · 2026-02-19
68.2%
#21164: feat(config): add lenient mode to resolveConfigEnvVars — preserve g...
by Mellowambience · 2026-02-19
68.1%
#15853: feat: add option to suppress media placeholder text
by MisterGuy420 · 2026-02-14
68.0%
#7133: feat: Automated Docker setup with environment-based configuration
by synetalsolutions · 2026-02-02
67.9%