fix: apply config env vars before model discovery (#32295) (thanks @hsiaoa)

This commit is contained in:
Peter Steinberger
2026-03-03 00:25:12 +00:00
parent 65dc3ee76c
commit 1e8afa16f0
2 changed files with 49 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ Docs: https://docs.openclaw.ai
### Fixes
- Gateway/Control UI basePath webhook passthrough: let non-read methods under configured `controlUiBasePath` fall through to plugin routes (instead of returning Control UI 405), restoring webhook handlers behind basePath mounts. (#32311) Thanks @ademczuk.
- Models/config env propagation: apply `config.env.vars` before implicit provider discovery in models bootstrap so config-scoped credentials are visible to implicit provider resolution paths. (#32295) Thanks @hsiaoa.
- Voice-call/Twilio signature verification: retry signature validation across deterministic URL port variants (with/without port) to handle mixed Twilio signing behavior behind reverse proxies and non-standard ports. (#25140) Thanks @drvoss.
- Hooks/webhook ACK compatibility: return `200` (instead of `202`) for successful `/hooks/agent` requests so providers that require `200` (for example Forward Email) accept dispatched agent hook deliveries. (#28204) Thanks @Glucksberg.
- Voice-call/Twilio external outbound: auto-register webhook-first `outbound-api` calls (initiated outside OpenClaw) so media streams are accepted and call direction metadata stays accurate. (#31181) Thanks @scoootscooob.

View File

@@ -0,0 +1,48 @@
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import {
CUSTOM_PROXY_MODELS_CONFIG,
installModelsConfigTestHooks,
unsetEnv,
withModelsTempHome as withTempHome,
withTempEnv,
} from "./models-config.e2e-harness.js";
import { ensureOpenClawModelsJson } from "./models-config.js";
installModelsConfigTestHooks();
const TEST_ENV_VAR = "OPENCLAW_MODELS_CONFIG_TEST_ENV";
describe("models-config", () => {
it("applies config env.vars entries while ensuring models.json", async () => {
await withTempHome(async () => {
await withTempEnv([TEST_ENV_VAR], async () => {
unsetEnv([TEST_ENV_VAR]);
const cfg: OpenClawConfig = {
...CUSTOM_PROXY_MODELS_CONFIG,
env: { vars: { [TEST_ENV_VAR]: "from-config" } },
};
await ensureOpenClawModelsJson(cfg);
expect(process.env[TEST_ENV_VAR]).toBe("from-config");
});
});
});
it("does not overwrite already-set host env vars", async () => {
await withTempHome(async () => {
await withTempEnv([TEST_ENV_VAR], async () => {
process.env[TEST_ENV_VAR] = "from-host";
const cfg: OpenClawConfig = {
...CUSTOM_PROXY_MODELS_CONFIG,
env: { vars: { [TEST_ENV_VAR]: "from-config" } },
};
await ensureOpenClawModelsJson(cfg);
expect(process.env[TEST_ENV_VAR]).toBe("from-host");
});
});
});
});