fix(skills): honor OPENAI_BASE_URL in whisper api skill#55597
Conversation
Greptile SummaryThis PR makes the
Confidence Score: 5/5Safe to merge — the change is minimal, default behavior is unchanged, and the only finding is a cosmetic doc redundancy. Two-line shell change is correct: default fallback preserves the original hardcoded URL, the trailing-slash strip prevents double-slash in the path, and the variable is properly quoted. No logic errors, no security concerns. The single P2 comment is a documentation style nit with no functional impact. No files require special attention.
|
| Filename | Overview |
|---|---|
| skills/openai-whisper-api/scripts/transcribe.sh | Adds OPENAI_BASE_URL support with a correct default fallback and a trailing-slash strip. Logic is sound and default behavior is fully preserved. |
| skills/openai-whisper-api/SKILL.md | Documents OPENAI_BASE_URL in two places; the API-key section now has a minor redundancy (OPENAI_API_KEY mentioned twice in quick succession). |
Prompt To Fix All With AI
This is a comment left during a code review.
Path: skills/openai-whisper-api/SKILL.md
Line: 52-54
Comment:
**Duplicate `OPENAI_API_KEY` mention**
The new line at 52 and the existing line 54 both start with "Set `OPENAI_API_KEY`", making the section slightly repetitive. Consider folding the `OPENAI_BASE_URL` note into the existing sentence instead of prepending a separate one.
```suggestion
Set `OPENAI_API_KEY`, or configure it in `~/.openclaw/openclaw.json`. Optionally set `OPENAI_BASE_URL` (for example `http://127.0.0.1:51805/v1`) to use an OpenAI-compatible proxy or local gateway:
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(skills): honor OPENAI_BASE_URL in wh..." | Re-trigger Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Merging this as a small, coherent skill fix. |
* fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) <asaf@asafshq.win> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) <asaf@asafshq.win> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) <asaf@asafshq.win> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) <asaf@asafshq.win> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) <asaf@asafshq.win> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…eUrl The dynamic-model resolver in extensions/openai/openai-provider.ts hardcoded `baseUrl: "https://api.openai.com/v1"` for every default GPT entry. This means setting `OPENAI_BASE_URL` in env (e.g. when running OpenClaw behind a LiteLLM/vLLM/local-proxy) has no effect — the discovered baseUrl wins via the `?? discoveredModel.baseUrl` fallback in src/agents/pi-embedded-runner/model.ts and the agent calls api.openai.com directly with a stale or proxy-style key, returning 401. Adds `resolveOpenAIDefaultBaseUrl()` in base-url.ts that returns `process.env.OPENAI_BASE_URL` (when non-empty) and falls back to the hardcoded URL otherwise. Replaces the 5 hardcoded literals in the dynamic model registry with the helper. This mirrors the precedent set by openclaw#55597 (honor OPENAI_BASE_URL in whisper api skill) and matches what the OpenAI Node SDK already does — its constructor falls back to env when `baseURL` is undefined. Provider-config baseUrl still takes precedence (resolver consults `providerConfig.baseUrl` before `discoveredModel.baseUrl`), so this is fully backwards-compatible: users with explicit config see no change, users with only the env var now get the routing they expected.
* fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) <asaf@asafshq.win> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
skills/openai-whisper-api/scripts/transcribe.shhonorOPENAI_BASE_URLOPENAI_BASE_URLoverride in the skill docsWhy
The current
openai-whisper-apiskill hardcodeshttps://api.openai.com/v1/audio/transcriptions, which makes it fail for users routing OpenAI-compatible traffic through a local gateway or proxy (for example LiteLLM).This keeps the existing default behavior, but allows:
OPENAI_BASE_URL=http://127.0.0.1:51805/v1OPENAI_BASE_URL=https://proxy.example.com/v1Testing
bash -n skills/openai-whisper-api/scripts/transcribe.sh${OPENAI_BASE_URL}/audio/transcriptionspnpm build && pnpm check && pnpm testnot run/home/asaf/.openclaw/openclaw.jsonAI assistance
AI-assisted. I verified the change and the resulting diff.