mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 17:54:32 +00:00
fix: pass proxy-aware fetchFn to media understanding providers
runProviderEntry now calls resolveProxyFetchFromEnv() and passes the result as fetchFn to transcribeAudio/describeVideo, so media provider API calls respect HTTPS_PROXY/HTTP_PROXY behind corporate proxies.
This commit is contained in:
committed by
Peter Steinberger
parent
ba3fa44c5b
commit
8c1e9949b3
@@ -13,6 +13,7 @@ import type {
|
||||
MediaUnderstandingModelConfig,
|
||||
} from "../config/types.tools.js";
|
||||
import { logVerbose, shouldLogVerbose } from "../globals.js";
|
||||
import { resolveProxyFetchFromEnv } from "../infra/net/proxy-fetch.js";
|
||||
import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
|
||||
import { runExec } from "../process/exec.js";
|
||||
import { MediaAttachmentCache } from "./attachments.js";
|
||||
@@ -429,6 +430,10 @@ export async function runProviderEntry(params: {
|
||||
throw new Error(`Media provider not available: ${providerId}`);
|
||||
}
|
||||
|
||||
// Resolve proxy-aware fetch from env vars (HTTPS_PROXY, HTTP_PROXY, etc.)
|
||||
// so provider HTTP calls are routed through the proxy when configured.
|
||||
const fetchFn = resolveProxyFetchFromEnv();
|
||||
|
||||
if (capability === "audio") {
|
||||
if (!provider.transcribeAudio) {
|
||||
throw new Error(`Audio transcription provider "${providerId}" not available.`);
|
||||
@@ -468,6 +473,7 @@ export async function runProviderEntry(params: {
|
||||
prompt,
|
||||
query: providerQuery,
|
||||
timeoutMs,
|
||||
fetchFn,
|
||||
}),
|
||||
});
|
||||
return {
|
||||
@@ -517,6 +523,7 @@ export async function runProviderEntry(params: {
|
||||
model: entry.model,
|
||||
prompt,
|
||||
timeoutMs,
|
||||
fetchFn,
|
||||
}),
|
||||
});
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user