fix: move Mistral compat into provider plugin

This commit is contained in:
Peter Steinberger
2026-03-28 04:08:25 +00:00
parent fd48e4090a
commit 5e93419c31
15 changed files with 343 additions and 24 deletions

View File

@@ -5,6 +5,22 @@ import path from "node:path";
type RestoreEntry = { key: string; value: string | undefined };
function isTruthyEnvValue(value: string | undefined): boolean {
if (!value) {
return false;
}
switch (value.trim().toLowerCase()) {
case "":
case "0":
case "false":
case "no":
case "off":
return false;
default:
return true;
}
}
function restoreEnv(entries: RestoreEntry[]): void {
for (const { key, value } of entries) {
if (value === undefined) {
@@ -43,7 +59,7 @@ function loadProfileEnv(): void {
process.env[key] = entry.slice(idx + 1);
applied += 1;
}
if (applied > 0) {
if (applied > 0 && !isTruthyEnvValue(process.env.OPENCLAW_LIVE_TEST_QUIET)) {
console.log(`[live] loaded ${applied} env vars from ~/.profile`);
}
} catch {