* Config: fail closed invalid config loads * CLI: keep diagnostics on explicit best-effort config * Tests: cover invalid config best-effort diagnostics * Changelog: note invalid config fail-closed fix * Status: pass best-effort config through status-all gateway RPCs * CLI: pass config through gateway secret RPC * CLI: skip plugin loading from invalid config * Tests: align daemon token drift env precedence
17 lines
612 B
TypeScript
17 lines
612 B
TypeScript
import type { OpenClawConfig } from "../../config/config.js";
|
|
import { resolveGatewayCredentialsFromConfig } from "../../gateway/credentials.js";
|
|
|
|
export function resolveGatewayTokenForDriftCheck(params: {
|
|
cfg: OpenClawConfig;
|
|
env?: NodeJS.ProcessEnv;
|
|
}) {
|
|
return resolveGatewayCredentialsFromConfig({
|
|
cfg: params.cfg,
|
|
env: {} as NodeJS.ProcessEnv,
|
|
modeOverride: "local",
|
|
// Drift checks should compare the configured local token source against the
|
|
// persisted service token, not let exported shell env hide stale service state.
|
|
localTokenPrecedence: "config-first",
|
|
}).token;
|
|
}
|