2026-03-08 00:27:41 +00:00
|
|
|
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,
|
2026-03-07 20:48:13 -05:00
|
|
|
env: {} as NodeJS.ProcessEnv,
|
2026-03-08 00:27:41 +00:00
|
|
|
modeOverride: "local",
|
2026-03-07 20:48:13 -05:00
|
|
|
// Drift checks should compare the configured local token source against the
|
|
|
|
|
// persisted service token, not let exported shell env hide stale service state.
|
2026-03-08 00:27:41 +00:00
|
|
|
localTokenPrecedence: "config-first",
|
|
|
|
|
}).token;
|
|
|
|
|
}
|