diff --git a/CHANGELOG.md b/CHANGELOG.md index 168ed898a6d..04b2094851b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/agents/models-config.applies-config-env-vars.test.ts b/src/agents/models-config.applies-config-env-vars.test.ts new file mode 100644 index 00000000000..617e153f4b9 --- /dev/null +++ b/src/agents/models-config.applies-config-env-vars.test.ts @@ -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"); + }); + }); + }); +});